1

Inside my local.xml file I have this

<default>
    <label>All Pages</label>
    <block type="page/html" name="root" output="toHtml">
        ...
        <block type="core/template" name="sidebarblock" as="sidebarblock" template="abcpage/html/sidebarblock.phtml">
            <block type="core/template" name="featuredrange" as="featuredrange" template="abcpage/html/recommendedrange.phtml"></block>
           <!--marker for later-->     
       </block>
       ....
   </block>

I can successfully add my "target" block by replacing "marker for later" with the block call:

<block type="abc_articles/catalog_category_list_article" name="category.info.articles" as="category_articles" template="abc_articles/catalog/product/list/article.phtml"></block>

and it all shows up using $this->getChildHtml("category_articles") in the sidebarblock.phtml

However, I just want to add this on "catalog_category_view" . I have a separate article-related layout xml file which is being picked up for other things but when I use this instead (clearing out the marker bit above):

    <catalog_category_view>
        <reference name="sidebarblock">
            <block type="abc_articles/catalog_category_list_article" name="category.info.articles" as="category_articles" template="abc_articles/catalog/product/list/article.phtml"></block>
        </reference>
    </catalog_catagory_view>

zip....nada...nothing...nowt and no block content.

Suggestions to fix please...guess I am just missing something fundamental here but cannot spot what (maybe because it is nearly 5pm). Thanks

0

First thing that occured to me is a typo in closing tag:

<catalog_category_view>
    <reference name="sidebarblock">
        <block type="abc_articles/catalog_category_list_article" name="category.info.articles" as="category_articles" template="abc_articles/catalog/product/list/article.phtml"></block>
    </reference>
</catalog_catagory_view>

into:

<catalog_category_view>
    <reference name="sidebarblock">
        <block type="abc_articles/catalog_category_list_article" name="category.info.articles" as="category_articles" template="abc_articles/catalog/product/list/article.phtml"></block>
    </reference>
</catalog_category_view>

Let me know if that helps, if not then add a comment and we'll investigate further.

P.S. If that's the case then I advice to use any XML Linter in your editor which will catch and prompt you with any mistyping/misclosing tags.

  • Good spot on the typo but it doesn't fix the problem. I did have linters for everything I use until recently - adding again to check through things. – Jon Holland Mar 2 '16 at 9:34
  • I have it working now. Turns out the same "name" was used in the block elsewhere in the config file.. – Jon Holland Mar 2 '16 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.