Magento admin:添加布局后未显示新块
Magento admin: New block not showing after adding in layout
我在自定义模块下的管理页面中添加了几个自定义块。当我尝试通过在我的模块的布局文件中添加一个条目来添加另一个块时,新块不显示。我错过了什么吗?
我现有的块显示良好。
<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>
你能改变名字属性吗?
例如
<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>
之后,刷新缓存
已解决问题。我在其他 phtml 文件所在的同一文件夹中有一个 data.phtml 模板文件,其中有以下代码。
<div id="order-billing_method" style="display:none"><?php echo $this->getChildHtml('billing_method') ?></div>
我将 display:none 更改为 display: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/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>
你能改变名字属性吗? 例如
<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>
之后,刷新缓存
已解决问题。我在其他 phtml 文件所在的同一文件夹中有一个 data.phtml 模板文件,其中有以下代码。
<div id="order-billing_method" style="display:none"><?php echo $this->getChildHtml('billing_method') ?></div>
我将 display:none 更改为 display:block,新的计费方法开始显示,没有任何问题。感谢您的回答。