Я пытаюсь использовать файл local.xml (где я делаю все мои обновления в макете ), чтобы удалить блок, который вложен в другой блок. можно легко удалить блок через тег <, удалив > или используя метод unsetChild, но я не могу удалить блок, который вложен в другой блок.Удаление блока, вложенного в блок через файл local.xml
Вот строка кода, которую я пытаюсь удалить (находится в файле customer.xml ). в частности, это блок называется "customer_account_dashboard_newsletter"
<customer_account_index translate="label">
<label>Customer My Account Dashboard</label>
<update handle="customer_account"/>
<!-- Mage_Customer -->
<reference name="root">
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
</reference>
<reference name="my.account.wrapper">
<block type="customer/account_dashboard" name="customer_account_dashboard" template="customer/account/dashboard.phtml">
<block type="customer/account_dashboard_hello" name="customer_account_dashboard_hello" as="hello" template="customer/account/dashboard/hello.phtml"/>
<block type="core/template" name="customer_account_dashboard_top" as="top" />
<block type="customer/account_dashboard_info" name="customer_account_dashboard_info" as="info" template="customer/account/dashboard/info.phtml"/>
<block type="customer/account_dashboard_newsletter" name="customer_account_dashboard_newsletter" as="newsletter" template="customer/account/dashboard/newsletter.phtml"/>
<block type="customer/account_dashboard_address" name="customer_account_dashboard_address" as="address" template="customer/account/dashboard/address.phtml"/>
<block type="core/template" name="customer_account_dashboard_info1" as="info1" />
<block type="core/template" name="customer_account_dashboard_info2" as="info2" />
</block>
</reference>
</customer_account_index>
Я понимаю, что это не работает прямо сейчас, но вот моя точка (находится в моем файле local.xml):
<customer_account_index>
<reference name="my.account.wrapper">
<action method="unsetChild"><name>customer_account_dashboard_newsletter</name></action>
</reference>
</customer_account_index>
Любые мысли? Спасибо.
Это не работает. Есть ли другой способ сделать это? – jdhaar
Также не работает для меня в Magento 1.8. – KoviNET