MAGENTO SIDEBAR BLOCK NOT SHOW - magento

I had a three block on my left sidebar.
when I am calling this three block as shown below, it shows only last block. First and second blocks are not showing
<reference name="left">
<remove name="catalog.leftnav" />
<block type="catalog/navigation" before="-"name="left-nav-brand" template="catalog/product/brand_sidebar.phtml"></block>
<block type="cms/block" name="left-nav">
<action method="setBlockId">
<block_id>left-nav</block_id>
</action>
</block>
<block type="catalog/product_list" name="catalog.product.latest" template="catalog/product/latest.phtml"></block>
</reference>
What would be the possible cause ?

Related

I cannot find where the static blocks are stacking up from on my home page

<block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
<label>Page Header</label>
<action method="setElementClass"><value>top-container</value></action>
<block type="core/template" name="pageHeader" template="page/html/topcontainer.phtml">
<block type="core/template" name="page.header" template="page/html/page_header.phtml"/>
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
</block>
</block>
This block lines up my entire home page. I need to add another block in to this list. This is read from CMS blocks in Admin panel. How can I find the source.
Use this code you will be able to read from CMS blocks in Admin panel with name contact.
<reference name="left">
<block type="cms/block" name="contact" before="-">
<action method="setBlockId"><block_id>contact</block_id></action>
</block>
</reference>

Magento - Add a static block to the left column

How would I go about adding a static block on my left column on the category pages?
I would like the static block to go underneath the main column so that it looks like this: http://imgur.com/iopEesf
Thank-you.
override catalog.xml layout file in your template.
in and
<catalog_category_layered>
<reference name="left">
<block type="cms/block" name="block-name">
<action method="setBlockId"><block_id>block_id</block_id></action>
</block>
</reference>
</catalog_category_layered>
<catalog_category_default>
<reference name="left">
<block type="cms/block" name="block-name">
<action method="setBlockId"><block_id>block_id</block_id></action>
</block>
</reference>
</catalog_category_default>

Append custom block after addtocart button on the product view page

I try to do it by custom module xml with this code
<catalog_product_view>
<reference name="product.info">
<block type="custom/myblock" name="myblock" after="addtocart" template="custom/myblock.phtml"/>
</reference>
</catalog_product_view>
but it doesn't work. If I change the reference name to content, it goes fine, but I would like to put it after the addtocard button.
How to assign custom block there?
try this its working
<catalog_product_view>
<reference name="product.info">
<block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml">
<block type="custom/myblock" name="myblock" template="custom/myblock.phtml"/>
</block>
</reference>
</catalog_product_view>
Try this, updated block type.
<catalog_product_view>
<reference name="product.info">
<block type="core/text_list" name="myblock" after="addtocart" template="custom/myblock.phtml"/>
</reference>
</catalog_product_view>

Edit category lay-out, but apply parts to products

I've got a custom category view.phtml for this category:
http://www.touchfix.nl/onderdelen
The sub-categories use their parent's XML-update, which is:
<reference name="catalog_category_default">
<reference name="content">
<remove name="category.products" />
<block type="catalog/category_view" name="alphabase.parts" template="catalog/category/view.parts.phtml">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.parts.phtml"></block>
</block>
</reference>
</reference>
<reference name="right">
<remove name="cms_waaromkiezen" />
<block type="cms/block" name="block_speerpunten_onderdelen">
<action method="setBlockId"><block_id>block_speerpunten_onderdelen</block_id></action>
</block>
</reference>
<reference name="head">
<action method="addCss"><stylesheet>css/categoryblocks.css</stylesheet></action>
</reference>
I want to achieve that the changes to "right" are also applied to products in these categories.
But when I apply these changes to products too in category settings, the "content" reference screws up my page and it returns a blank page.
How can I reference the catalog_category view, so that the "content" update is only done when in category view and not in product view?
catalog_category_default isn't a reference, it's a handle
have you tried changing to:
<catalog_category_default>
I managed to do the trick with the following:
<reference name="content">
<reference name="category.products">
<action method="setTemplate"><template>catalog/category/view.repair.phtml</template></action>
<reference name="product_list">
<action method="setTemplate"><template>catalog/product/list.repair.phtml</template></action>
</reference>
</reference>
</reference>
<reference name="right">
<remove name="cms_waaromkiezen" />
<block type="cms/block" name="block_speerpunten_reparatie">
<action method="setBlockId"><block_id>block_speerpunten_reparatie</block_id></action>
</block>
</reference>
<reference name="head">
<action method="addCss"><stylesheet>css/categoryblocks.css</stylesheet></action>
</reference>
The difference was not to delete the blocks and add new ones with the correct template, but to change the template files of the corresponding items. I can now also refer to the product view block with <reference name="product.info">, which will be my next step.

Magento Block Positioning Never Works

Hello I always seem to have problems positions blocks.
Please see the website I am working on: http://www.hemptationz.com
I want the blocks on the left sidebar to appear in this order:
Facebook Block (callouts/facebook.pthml)
Currency Block (directory/currency.phtml)
Product Categories Block (vertnav/left.phtml)
Information Links Block (callouts/left_col.phtml)
This is the code I have in the XML layout files:
Catalog.xml
<reference name="left">
<block type="core/template" name="facebook" template="callouts/facebook.phtml" after="currency" />
<block type="core/template" name="left.permanent.callout" template="callouts/left_col.phtml" after="catalog.vertnav" />
</reference>
vertnav.xml
<reference name="left">
<block type="vertnav/navigation" name="catalog.vertnav" template="vertnav/left.phtml" before="left.permanent.callout" />
</reference>
directory.xml
<layout version="0.1.0">
<!--
Category default layout
-->
<default>
<reference name="head">
<block type="core/template" name="optional_zip_countries" as="optional_zip_countries" template="directory/js/optional_zip_countries.phtml" />
</reference>
</default>
<catalog_category_default>
<reference name="left">
<block type="directory/currency" name="currency" before="facebook" template="directory/currency.phtml"/>
</reference>
</catalog_category_default>
<!--
Category layered navigation layout
-->
<catalog_category_layered>
<reference name="left">
<block type="directory/currency" name="currency" before="facebook" template="directory/currency.phtml"/>
</reference>
</catalog_category_layered>
<!--
Catalog Search layout
-->
<catalogsearch_advanced_index>
<reference name="left">
<block type="directory/currency" name="right_currency" before="facebook" template="directory/currency.phtml"/>
</reference>
</catalogsearch_advanced_index>
<catalogsearch_result_index>
<reference name="left">
<block type="directory/currency" name="currency" before="facebook" template="directory/currency.phtml"/>
</reference>
</catalogsearch_result_index>
<catalogsearch_advanced_result>
<reference name="right">
<block type="directory/currency" name="right_currency" before="facebook" template="directory/currency.phtml"/>
</reference>
</catalogsearch_advanced_result>
</layout>
Thanks hope you can help me.
The before and after attributes are limited in scope. They can only influence
The order of blocks within a particular sub-block when that sub-block is a core/test_list or other block that automatically renders sorted children.
You've not given enough context around how you're using the attributes in your question to give you specific advice, but I don't think you can do what you think you can with the feature. Be more explicit in your question and provide code example, along with "I expected foo, I got bar" style context, and will help you.
You want this order:
1. Facebook
2. Currency
3. Vertical Navigation
4. Information Links
but in your layout you have specified that facebook is after currency. If you want something to show first you have to use before="-" (in facebook link), then use after="facebook" for currency, after="currency" for catalog.vertnav and use after="-" for left.permanent.callout to position it on the bottom.

Resources