如何将Mageworx
下载块放在magento之外?
{{block type="downloads/link" id="5,6,7" title="Files"}}
几乎所有Magento块都可以这样编程:
<?php
require_once('app/Mage.php'); // don't forget to replace app/Mage.php with the actual path to your Magento
$mage = Mage::app();
// create the block
$block = $mage->getLayout()->createBlock('downloads/link', '', array('id' => '1,5,6,7', 'title' => 'Files'));
// output the block
echo $block->toHtml();
请注意,最有可能的是,您将面临这样的"Magento之外"输出的典型问题,如缺少脚本,样式,图像。
在这种情况下,所有东西都以类似的方式连接在一起。所有的依赖关系都可以在相应的布局中找到。