Magento管理员:在添加布局后未显示新块
我在自定义模块下的管理页面中添加了几个自定义块。当我尝试通过在模块的布局文件中添加一个条目来添加另一个块时,新块不会显示。我错过了什么?Magento管理员:在添加布局后未显示新块
我的现有区块显示正常。
<block type="adminhtml/sales_order_create_shipping_method" template="sales/order/create/abstract.phtml" name="shipping_method">
<block type="adminhtml/sales_order_create_shipping_method_form" template="xxxx/xxxx/quote/create/shipping/form.phtml" name="form" />
</block>
块我想在它下面添加,并且不显示
<block type="adminhtml/sales_order_create_billing_method" template="sales/order/create/abstract.phtml" name="billing_method">
<block type="adminhtml/sales_order_create_billing_method_form" template="xxx/xxx/quote/create/billing/form.phtml" name="form" />
</block>
顺便说一句,如果我把它已存在块内的块被加载。想知道如何让它出现在现有之外,作为一个独立的块。
<block type="adminhtml/sales_order_create_shipping_method" template="sales/order/create/abstract.phtml" name="shipping_method">
<block type="adminhtml/sales_order_create_shipping_method_form" template="xxxx/xxxxxx/quote/create/shipping/form.phtml" name="shipping_form" />
<block type="adminhtml/sales_order_create_billing_method" template="sales/order/create/abstract.phtml" name="billing_method">
<block type="adminhtml/sales_order_create_billing_method_form" template="xxxxxx/xxxxxxxx/quote/create/billing/form.phtml" name="billing_form" />
</block>
</block>
固定的问题。我在其他phtml文件所在的同一文件夹中有一个data.phtml模板文件,其中有以下代码。
<div id="order-billing_method" style="display:none"><?php echo $this->getChildHtml('billing_method') ?></div>
我改变了显示:无显示:块和新的计费方法块开始显示没有任何问题。感谢您的答案。
我有一个类似的问题,在管理页面上没有显示自定义块。在我的情况下,我希望自定义块出现在adminhtml_sales_order_shipment_view中。如果你不介意,看看这个未解决的问题:http://stackoverflow.com/questions/39340112/adding-block-into-adminhtml-shipment-view 谢谢你的提前 – may
您可以更改名称属性吗? 例如
<block type="adminhtml/sales_order_create_shipping_method" template="sales/order/create/abstract.phtml" name="shipping_method">
<block type="adminhtml/sales_order_create_shipping_method_form" template="xxxx/xxxx/quote/create/shipping/form.phtml" name="shipping_form" />
</block>
和
<block type="adminhtml/sales_order_create_billing_method" template="sales/order/create/abstract.phtml" name="billing_method">
<block type="adminhtml/sales_order_create_billing_method_form" template="xxx/xxx/quote/create/billing/form.phtml" name="billing_form" />
</block>
,后,刷新缓存
这也不起作用 –
感谢您的提示。编辑我的问题。当我将它放入现有块中时,该块正在加载。但我仍然需要它作为一个独立的块。 –
您正在运行的是哪个版本的Magento?如果1.9.2.2或者您已经应用了修补程序6788或更高版本,则可能会发现需要在“系统”>“权限”>“块”和“系统”>“权限”>“变量”中手动启用块。有关更多详细信息,请参见[https://magento.com/security/patches/supee-6788-technical-details] –
程序化添加块时不是这种情况。只为静态块:) –
啊我得到你,这只是我有一个类似的问题,这是我的修复。抱歉! –