Magento块可以';不要引用
我正在为前端创建一个新的Magento 1.7.0.2模块,但我无法将我的一个块附加到页面的任何适当点上。目前它隐藏在页面底部,所有默认内容都在上面。我还没有真正搞乱前端,所以这是一个相当新的Magento安装。我已经尝试过引用标记,但是如果我现在包含它们,那么无论我在名称引号中添加了什么,我的块都会完全消失 我的布局:Magento块可以';不要引用,magento,module,block,Magento,Module,Block,我正在为前端创建一个新的Magento 1.7.0.2模块,但我无法将我的一个块附加到页面的任何适当点上。目前它隐藏在页面底部,所有默认内容都在上面。我还没有真正搞乱前端,所以这是一个相当新的Magento安装。我已经尝试过引用标记,但是如果我现在包含它们,那么无论我在名称引号中添加了什么,我的块都会完全消失 我的布局: <?xml version="1.0"?> <layout version="0.1.0"> <default> <
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
</default>
<!--<reference name="root">-->
<makeorder_index_index>
<block type="makeorder/testblock" output="toHtml" name="orderdispaly"
template="makeorder/orderdisplay.phtml"/>
</makeorder_index_index>
<!--</reference>-->
</layout>
我当前的模板:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test Block</title>
</head>
<body>
<h2>Hello!</h2>
<div class="Test1">
<?php echo $this->displaystyles();?>
</div>
<br /><hr /><br />
<div class="test2">
<?php echo $this->displaypapers();?>
</div>
</body>
</html>
试块
你好
我想把块放在这页的中间。任何帮助都将不胜感激,因为我显然错过了一些重要的事情 布局xml中有几个错误,但我不想纠正它们,而是从这里开始(除非您有理由想在自己的模板中重新创建完整的页面布局??) 布局:
<?xml version="1.0"?>
<layout version="0.1.0">
<makeorder_index_index>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
<reference name="content">
<block type="makeorder/testblock" name="orderdispaly" template="makeorder/orderdisplay.phtml" />
</reference>
</makeorder_index_index>
</layout>
<h2>Hello!</h2>
<div class="Test1">
<?php echo $this->displaystyles();?>
</div>
<br /><hr /><br />
<div class="test2">
<?php echo $this->displaypapers();?>
</div>
第/1页column.phtml
模板:
<?xml version="1.0"?>
<layout version="0.1.0">
<makeorder_index_index>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
<reference name="content">
<block type="makeorder/testblock" name="orderdispaly" template="makeorder/orderdisplay.phtml" />
</reference>
</makeorder_index_index>
</layout>
<h2>Hello!</h2>
<div class="Test1">
<?php echo $this->displaystyles();?>
</div>
<br /><hr /><br />
<div class="test2">
<?php echo $this->displaypapers();?>
</div>
你好!
太棒了!好的,在开发过程中,我得到了参考和手柄切换。谢谢。有人知道为什么这个块会重复出现在页面底部吗?我的模板已经用一个表单扩展了,但是布局仍然和你的一样。该块仅在页面的最底部重复。在我获得网格视图之前,我在管理中看到了同样的事情。