我使用两个插件,easycatalogimg和bannerslider。
出于理智的目的,我使用默认的Magento主题,我只是想学习模板引擎。
当我启用easycatalogimg时,它会出现在主页上的横幅滑块上方。我正在使用以下代码调用CMS->主页中的bannerslider.phtml。
{{block type='bannerslider/bannerslider' template='bannerslider/bannerslider.phtml'}}
我想叫bannerslider,然后叫easycatagimg。问题是,我无法确定什么是block type
easycatagimg。如果可以的话,我只需关闭主页显示,然后在其下方放置块。当我打开设置以使easycatalogig出现在主页上时,它会在页面其他内容的上方插入。
有没有我可以打开的文件来确定easycatalogig是什么块类型?然后我可以做这个代码,就在bannerslider下面。
{{block type='foo/bar' template='default/default/easycatalogimg.home.phtml'}}
现在,easycatalogig出现在主页上。
在理想的世界里,这里的解决方案是我编辑一个页面,比如。。。
frontend/base/default/template/cms/content_heading.phtml
在该页面中,调用bannerslider.phtml和easycatalogimg/homepage.phtml.
打开想要知道类型的块的模板文件。如果它是一个默认的Magento模板,它通常会在顶部有Block_Class名称。如果没有,运行:
<?php echo get_class($this) ?>
这将为您提供Block_Class名称,然后将其转换为Magento的调用约定,例如:
<?php $block = $this->getLayout()->getBlock('core/template') ?>
其中"核心/模板"被翻译为Mage_core _Block_template