07-19-2023, 03:33 PM
I hope you can understand my question!!
The question below is to do with assigning and referencing blocks within a Magento CMS Page.
The Problem
-----------
I have a cms page called Home page. The content of this page is
{{block type='core/template' name='homepage_html' template='page/html/homepage.phtml'}}
In page/html/homepage.phtml i have some basic html for my sites homepage.
**-> Up to this point everything works fine.**
I want to pull in my latest posts from my aw_blog module. I have a file aw_blog/homepage_posts.phtml that works perfectly if i add this code to cms.xml
<cms_index_index translate="label">
<reference name="content">
<block type="blog/blog" name="home_blog" template="aw_blog/homepage_posts.phtml"/>
</reference>
</cms_index_index>
The trouble with this is it adds the posts under the content in my page/html/homepage.phtml file.
I have this line in my page/html/homepage.phtml where i would like the list of posts to appear
<?php echo $this->getChildHtml('home_blog') ?>
and have tried referencing homepage_html in place of content in my cms.xml file
<cms_index_index translate="label">
<reference name="homepage_html">
<block type="blog/blog" name="home_blog" template="aw_blog/homepage_posts.phtml"/>
</reference>
</cms_index_index>
but no joy!!!
The Question
------------
So my question to you is, is there a way to assign the latest post block to the homepage_html block in order to draw in the latest posts using the $this->getChildHtml() method.
Thanks for your time.
The question below is to do with assigning and referencing blocks within a Magento CMS Page.
The Problem
-----------
I have a cms page called Home page. The content of this page is
{{block type='core/template' name='homepage_html' template='page/html/homepage.phtml'}}
In page/html/homepage.phtml i have some basic html for my sites homepage.
**-> Up to this point everything works fine.**
I want to pull in my latest posts from my aw_blog module. I have a file aw_blog/homepage_posts.phtml that works perfectly if i add this code to cms.xml
<cms_index_index translate="label">
<reference name="content">
<block type="blog/blog" name="home_blog" template="aw_blog/homepage_posts.phtml"/>
</reference>
</cms_index_index>
The trouble with this is it adds the posts under the content in my page/html/homepage.phtml file.
I have this line in my page/html/homepage.phtml where i would like the list of posts to appear
<?php echo $this->getChildHtml('home_blog') ?>
and have tried referencing homepage_html in place of content in my cms.xml file
<cms_index_index translate="label">
<reference name="homepage_html">
<block type="blog/blog" name="home_blog" template="aw_blog/homepage_posts.phtml"/>
</reference>
</cms_index_index>
but no joy!!!
The Question
------------
So my question to you is, is there a way to assign the latest post block to the homepage_html block in order to draw in the latest posts using the $this->getChildHtml() method.
Thanks for your time.