Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 429 Vote(s) - 3.4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Magento: How can i assign a block to a parent block added to a CMS page

#1
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.

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through