I try to add a static block created in CMS -> static block (id : qualif).
To do this I create a local.xml in app/design/frontend/default/default/layout and I insert :
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="right">
<block type="cms/block" name="cms_qualif" after="-">
<action method="setBlockId"><block_id>qualif</block_id></action>
</block>
</reference>
</default>
</layout>
But anything appears on my right col.
I've check that my template is "default" in Admin -> System-> Design.
Have you any solution ?
Try to add the xml in catalog.xml after the <default> tag:
<reference name="right">
<block type="cms/block" name="cms_qualif" after="-">
<action method="setBlockId"><block_id>qualif</block_id></action>
</block>
</reference>
And don't forget to clear cache after you make the changes.
Related
With the following code, the 'myinfo' tab is added tie the customer edit page, but it appears a second element after the 'customer view'.
<?xml version="1.0"?>
<layout version="0.1.0">
<adminhtml_customer_edit>
<reference name="left">
<reference name="customer_edit_tabs">
<block type="mystuff/adminhtml_customer_edit_tab_myinfo" name="tab_points"
template="my/stuff/customer/myinfo.phtml">
...
</block>
<action method="addTab">
<name>my_stuff</name>
<block>tab_myinfo</block>
<!-- TODO find way to change sequence of tab added -->
</action>
</reference>
</reference>
</adminhtml_customer_edit>
</layout>
...I'd like to add a screenshot... but my reputation is too low :(
How can the sequence of appearance be defined? I tried the following:
1. <action method="addTab" after="cart">
...
2. <action method="addTab">
<after>cart</after>
...
3. <action method="addTab">
<sequence>999</sequence>
...
... but no change
In ShopShark(this module for blog) i have this code
<?xml version="1.0"?>
<layout version="0.1.0">
//a lot of code//
<blog_post_view>
<remove name="left"/>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
<reference name="content">
<block type="blog/post" name="post" template="blog/post.phtml">
<block type="blog/product_toolbar" name="blog_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_pager" name="product_list_toolbar_pager"/>
</block>
</block>
</reference>
</blog_post_view>
// a lot of code //
</layout>
Next i try to change post page. I found the solution here http://blog.chapagain.com.np/magento-overriding-template-file-from-custom-module/ , but its doesnt work! My code
<?xml version="1.0"?>
<layout version="0.1.0">
//a lot of code//
<blog_post_view>
<action method="setTitle">
<title>My Blog</title>
</action>
<reference name="post">
<action method="setTemplate">
<template>test/post.phtml</template>
</action>
</reference>
</blog_post_view>
// a lot of code //
</layout>
What you are exactly trying to do is not clear.I think you messed up with the structural block here. I am not exactly sure but needed to see the xml file where you have created the block "post".If you have not created the block "post",then you cannot use the code
<reference name="post">
From your code it seems that you are trying to change the template to post.phtml.
If that is the case than just change
<reference name="post">
to <reference name="content">
other part seem fine.
Hope this will help!
I've created a magento (1.7 CE) local module to add, in the Admin section, some info to the product list displayed in the Orders received.
Internally all seems to work good except that i'm not succeeding in replacing the template used to render each product line in the order.
In app/design/adminhtml/default/default/layout/sales.xml i have this code
<adminhtml_sales_order_view>
<reference name="head">
<action method="addJs"><file>mage/adminhtml/giftmessage.js</file></action>
<action method="addJs"><file>mage/adminhtml/giftoptions/tooltip.js</file></action>
</reference>
<reference name="content">
<block type="adminhtml/sales_order_view" name="sales_order_edit"></block>
</reference>
<reference name="left">
<block type="adminhtml/sales_order_view_tabs" name="sales_order_tabs">
<block type="adminhtml/sales_order_view_tab_info" name="order_tab_info" template="sales/order/view/tab/info.phtml">
<block type="adminhtml/sales_order_view_messages" name="order_messages"></block>
<block type="adminhtml/sales_order_view_info" name="order_info" template="sales/order/view/info.phtml"></block>
<block type="adminhtml/sales_order_view_items" name="order_items" template="sales/order/view/items.phtml">
<action method="addItemRender"><type>default</type><block>adminhtml/sales_order_view_items_renderer_default</block><template>sales/order/view/items/renderer/default.phtml</template></action>
<...
I would like to replace the template set by the LAST line you see (the addItemRenderer).
In my module config.xml i have
<adminhtml>
<layout>
<updates>
<my_ext>
<file>myext_update.xml</file>
</my_ext>
</updates>
</layout>
</adminhtml>
and in app/design/adminhtml/default/default/layout/myext_update.xml i have
<?xml version="1.0"?>
<admin_sales_order_view>
<reference name="left">
<reference name="sales_order_tabs">
<reference name="order_tab_info">
<reference name="order_items">
<action method="addItemRender">
<type>default</type>
<block>adminhtml/sales_order_view_items_renderer_default</block>
<template>myext/sales/order/view/items/renderer/default.phtml</template>
</action>
</reference>
</reference>
</reference>
</reference>
</admin_sales_order_view>
Obviously i have the file in app/design/adminhtml/default/default/template/myext/sales/order/view/items/renderer/default.phtml
but it is still not used.
Do you have a solution?
Found the solution after some day of struggling...
the code and the method is all good, but i mistyped the handle name to update in the myext_update.xml
i wrote
<admin_sales_order_view>
but , as in the original sales.xml, the handle name was
<adminhtml_sales_order_view>
Actually this wont work as the way you proceeded. You need to update the layouts.
Have some idea about layout updates also render the layout in yout module
Check here http://www.magentocommerce.com/design_guide/articles/intro-to-layouts
I have followed the magento tutorials to create a module. In the 3rd part "Part 3 - Magento Controller Dispatch". I have no problem to create a module.But in the Part 4, i am confusing about the layout,
How to create a page template in magento is written there.But, When i followed the code "create a file at"
app/design/frontend/base/default/layout/local.xml
I have already the local.xml file in my theme. So i confused where can i create the file and add the lines
<layout version="0.1.0">
<default>
<block type="page/html" name="root" output="toHtml" template="magentotutorial/helloworld/simple_page.phtml" />
</default>
</layout>
I have already the local.xml file where the following lines are written.
left.permanent.callout
<reference name="right">
<action method="unsetChild"><name>right.permanent.callout</name></action>
<remove name="paypal.partner.right.logo"/>
</reference>
<reference name="root">
<remove name="global_messages" />
</reference>
<reference name="content">
<block type="core/template" name="alert_global_messages" template="core/messages.phtml" before="-" />
</reference>
<reference name="before_body_end">
<block type="core/template" name="jquery_noconflict" template="jquery/noconflict.phtml" before="-" />
</reference>
Now, how can i add the line
in my local.xml file.
I use magento and I have my own template but on my product detail page on the left side I have compare products. How can I delete this block?
Just create local.xml file under your theme/layout/local.xml and place below code.
<layout version="0.1.0">
<default>
<!-- remove compare products -->
<remove name="catalog.compare.sidebar" />
</default>
</layout>
This block is added in layout files. You can remove this block in original files or in your extension layout.
By default this block is added in files
/app/design/frontend/base/default/layout/catalog.xml
/app/design/frontend/base/default/layout/customer.xml
1) Copy this files to your theme folder and remove strings
<block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
2) In your layout file add lines
<default>
<reference name="right">
<action method="unsetChild"><name>catalog.compare.sidebar</name></action>
</reference>
<reference name="left">
<action method="unsetChild"><name>catalog.compare.sidebar</name></action>
</reference>
</default>
<customer_account>
<reference name="left">
<action method="unsetChild"><name>catalog.compare.sidebar</name></action>
</reference>
<reference name="right">
<action method="unsetChild"><name>catalog.compare.sidebar</name></action>
</reference>
</customer_account>
To completely disable compare products functionality you can use this free extension.
Just remove the file /app/design/frontend/base/default/template/catalog/product/compare/sidebar.html or rename it.
Just remove this block from layout/catalog.xml and compare products section will be gone :
<reference name="left">
<block type="catalog/product_compare_sidebar" after="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
</reference>