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 amage_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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -