Magento Forum

How can I return layout with cms/page content in my controller ? 
 
polis4r
Jr. Member
 
Total Posts:  4
Joined:  2012-11-19
 

Hi everyone!

I’m new member in Magento community and it’s my first experience with Magento (1.6)
I’m trying to make a landing page module. I catch in my URL a parameter with a regex and in terms of it, I catch the informations on the cms page (the layout, the content ...).

For example, I have this URL : http://www.website.com/landing/keyword.html, my parameter will be “keyword”.

I made a Router where I redirect on my controller with my parameter (keyword), and inside of it, I’m trying to load my layout.

For example, in my admin page, I defined my layout as “One column”, then I trying to set this layout in my controller response. (page/1-column.phtml)

$this->loadLayout();
$foo $this->getLayout()->createBlock('cms/page')->setTemplate($page->getRootTemplate())->setPage($page);
$this->getLayout()->getBlock('content')->append$foo );
$this->renderLayout();

I have the content of the CMS page but not my template with my CSS/JS ..
I don’t know if I’m understandable and I’m sorry for that (and my bad english). If you need more informations I’ll glady give them.

Thank you!
Best regards smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
kiatng
Enthusiast
 
Total Posts:  875
Joined:  2008-09-03
Kuala Lumpur, Malaysia
 

Try

$this->loadLayout('default');
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top