我有一个模块名称空间/搜索,当我到达此处时安装了该模块。我从它里面取了< [namespace] _index_index>内容并在此处显示。这是来自当前正在工作的模块。模板不适用于自定义前端模块
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>
<reference name="content">
<block type="search/search" name="search" template="ifi_search/index.phtml" />
</reference>
我已经使用上述作为helloworld模块的模板。
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>
<reference name="content">
<block type="helloworld/helloworld" name="helloworld" template="helloworld/helloworld.phtml" />
</reference>
随着我留下了一个完全空白页第二个例子中,开发人员模式已开启。为了扩大我对这个主题的知识,我没有任何其他的信息可以用于调试。如果添加了任何有用的内容,请发表评论。我不确定是否可以在这一点上重现此问题。
根据页面顶部的警告,该文章包含一些令人讨厌的信息,即使信息没有过期。也就是说,根据下面的@benmarks,如果你像这样替换了根块,并且Magento可以做到这一点,你需要一个output =“toHtml”属性。 –
我正在运行一个旧版本的Magento,所以我没有看到文章被告知是问题。我不是复制我的,而是复制了第二个示例中的部分代码并进行了编辑,但我一定在事故中删除了output =“toHtml”,但没有意识到它。我已经尝试了几种不同的变体,以及IndexController中的几种不同的方法。我发现做的工作是使用 page.phtml/ –
Sturm