【发布时间】:2013-06-01 22:09:35
【问题描述】:
我已经非常彻底地研究了这个主题,但找不到答案。
我正在尝试将 Magneto 头包含到 WordPress 页面中。我创建了一个新的 wordpress 模板并在其中添加了以下代码。
try {
require_once ABSPATH . '/app/Mage.php';
if (Mage::isInstalled()) {
$mage = Mage::app();
Mage::getSingleton('core/session', array('name' => 'frontend'));
if(Mage::getDesign()->designPackageExists('xxx')) {
Mage::getDesign()->setPackageName('xxx');
Mage::getDesign()->setTheme('xxx');
}
// init translator
$mage->getTranslator()->init('frontend');
// init head
$head = $mage->getLayout()->getBlockSingleton('page/html_head');
} }
然后在我的模板中再往下一点
echo $head->toHtml();
现在正在发生的是头部的某些部分正在回显,而某些部分则没有。
当我进入 head.phtml 并试图弄清楚发生了什么时,我注意到任何包含
的行$this->getChildHtml()
没有得到回显。
我看了this example,发现作者手动添加了html和CSS。为什么是这样?为什么不自动添加它们?这是一个相关的问题吗
谢谢
【问题讨论】:
标签: magento