문제

i want get content in CMS Block, i tryed this code but it not show content

My code :

<?php foreach ($this->getAgreements() as $_a): ?>
     <?php echo $_a->getContent() ?>
<?php endforeach ?>

It not show content, but show this:

{{block type="cms/block" block_id="gs_business_terms"}}
도움이 되었습니까?

해결책

Use this code to echo content of cms block

<?php foreach ($this->getAgreements() as $_a): ?>
     <?php echo Mage::helper('cms')->getPageTemplateProcessor()->filter($_a->getContent());?>
<?php endforeach ?>

This should work

다른 팁

You can call like this one.

<?php foreach ($this->getAgreements() as $_a): ?>
     <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId($_a->getIdentifier())->toHtml(); 
?> 
<?php endforeach ?>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top