Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

getChildHtml and block questions
 
JDS80
Member
 
Total Posts:  56
Joined:  2009-02-09
 

I want to load 2 modified versions of the catalog\category\view.phtml file on separate places in my 3columns.phtml.
What I want is to display categoryname and catalogdescription, on separate places, independet of each other.

This is the to tags that should load the content into my 3columns.phtml file.
<?php echo $this->getChildHtml('getcatalogdescription') ?>
<?php echo $this->getChildHtml('getcatalogname') ?>

in “page.xml” i have done this to make the reference between the getChildHtml and the block tag.
<block type="core/text_list" name="getcatalogname" as="getcatalogname"/>
<block type="core/text_list" name="getcatalogdescription" as="getcatalogdescription"/>

in catalog.xml i have done the follwing blocks. Places in the default section, but also tried to move them outside that handle.
<reference name="getcatalogname">
<block type="catalog/category_view" template="catalog/category/viewcatname.phtml">
</block>
</reference>

<reference name="getcatalogdescription">
<block type="catalog/category_view" template="catalog/category/viewcatdescripton.phtml">
</block>
</reference>

This stuff works when using them one at the time, if i remove the <reference name="getcatalogdescription"> section, the getcatalogname
works, and the other way around it also works.
The problem is when both <reference name="getcatalogname"> and <reference name="getcatalogdescription"> exists at the same time.

Even if i remove the <?php echo $this->getChildHtml('getcatalogdescription') ?> from my layout file, the place where the catalogname should be, shows the catalogdescripton (and the catalogname, too)

Really confusing to me, i thought i understood the basics with loading templates into templates, but i must be missing something.

Does anyone have a clue what ive done wrong, then i would be glad to know smile

Regards
Johan

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top