AW Blog different layout for posts view

by Iva Korlevic
June 17, 2013

Hi,
I had some trouble recently with Magento 1.7.0.2. and AW Blog. I couldn’t set different layout for blog posts view. My Blog listing needed to have 1-column layout and blog posts view 2columns-right layout.

Naturally I resorted to normal solution – add this lines inside aw_blog.xml file, in blog_post_view section:

// inside aw_blog.xml layout file
<blog_post_view>
    <!-- ... -->
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
        </reference>

        <reference name="content">
          <!-- ... -->
        </reference>
</blog_post_view>

Nothing happened.
After a bit of file searching I found AW_Blog_Helper_Post of AW Blog extension. I simply commented out a line at the end of renderPage function:

 // inside AW_Blog_Helper_Post of AW Blog extension

public function renderPage(Mage_Core_Controller_Front_Action $action, $identifier=null) {

/*...*/

  //$action->getLayout()->getBlock('root')->setTemplate(Mage::getStoreConfig('blog/blog/layout'));
  //above line was rewriting set layout in aw_blog.xml
  $action->renderLayout();

 return true;

And voila! It now changes the layout of blog posts view to my desired layout.

Hope this helps,
Iva

Comments

2 thoughts on “AW Blog different layout for posts view”

    1. Hi Jafar,
      to set the 1cokumn layout for post listing, open xml file aw_blog.xml, find the and then add this xml code:


      Save, upload, and of course clear cache. 🙂

Tell us your opinion:

Your email address will not be published. Required fields are marked *