php - Magento - Include TPL files in CMS -
i'm performing quick job magento-based site , can't recall how pull in tpl files within cms. i've tried using following code in cms page...
{{block type="cms/block" block_id="page_heading" template="cms/content_heading2.phtml"}}
the tpl file in correct folder... app/design/frontend/default/wfs/cms
i'm not sure how include phtml file correctly. possible provide correct syntax?
thanks!
when
`type="cms/block"`
you're telling magento create 'cms/blocktemplate object, translates a
mage_cms_block_block` class. if take @ block's source
#file: app/code/core/mage/cms/block/block.php protected function _tohtml() { $blockid = $this->getblockid(); $html = ''; if ($blockid) { $block = mage::getmodel('cms/block') ->setstoreid(mage::app()->getstore()->getid()) ->load($blockid); if ($block->getisactive()) { /* @var $helper mage_cms_helper_data */ $helper = mage::helper('cms'); $processor = $helper->getblocktemplateprocessor(); $html = $processor->filter($block->getcontent()); } } return $html; }
you can see doesn't render templates, instead renders magento's static block objects.
try
`type="core/template"`
instead, , make sure block id unique.
Comments
Post a Comment