0

I inserted 3 widget in CMS -> Pages. I have to do display those widgets in home page.

I used this code

$aCmsPage = Mage::getModel('cms/page')->load('main-page', 'identifier');
echo $theContent = $aCmsPage->getContent();

but output was like this

{{widget type="meigeewidgets/featuredcategory" featured_category="category/5" template="meigee/meigeewidgets/slider.phtml" products_amount="15" slider_speed="1000" slider_displayslideqty="4" slider_moveslideqty="1" slider_easing="easeInQuad" widget_id="7646"}} 

i am new to magento. Can you please help me to find a solution?

David Manners
27.3k9 gold badges78 silver badges220 bronze badges
asked Oct 8, 2013 at 16:29

1 Answer 1

1

Did some digging through the CMS module in Magento and it seems that Mage_Cms_Block_page::_toHtml actually implements what you are looking for.

$helper = Mage::helper('cms');
$processor = $helper->getPageTemplateProcessor();
$html = $processor->filter($this->getPage()->getContent());

Now I didn't test it but it seems that this returns the page content with the rendered widgets.

answered Oct 8, 2013 at 19:28

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.