I want to pull the content of a CMS page into my static block, if you know of a way to do this I would be grateful.
Static Blocks are sections of content within a page. Magento allows you to create these blocks of content which can then be implemented in various places on your website.
Content blocks are sometimes referred to as static blocks, or CMS blocks. They can be used to display fixed information such as text, images, and embedded video, and dynamic information that is provided by a widget or originates in a database or other source.
Haven't tested this, but it should work. If you have the unique ID of the cms page (not the identifier):
$page = Mage::getModel('cms/page');
$page->setStoreId(Mage::app()->getStore()->getId());
$page->load($pageId);
Otherwise if you have the page's identifier (i.e. URL key), use something like this:
$urlKey = "url_key";
$page->load($urlKey,'identifier');
Then finish with:
$helper = Mage::helper('cms');
$processor = $helper->getPageTemplateProcessor();
$html = $processor->filter($page->getContent());
return $html;
== EDIT ==
Added the template parsing steps as suggested by Alan
Do it the other way round. Create your content in a static block and include it in a page, or other static blocks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With