开发者

Magento: add static block above footer only for Product View pages?

In Magent开发者_运维问答o, how can I add a static block just above the footer, but only on Product View pages? I've got it partially working by modifying catalog.xml and page/html/footer.phtml - but it's showing on all pages, which is not what I am looking for.

Also I must be able to show it so it spans both columns on a 2-column layout.

Any ideas anyone?

Cheers, Michael.


If you put it into the page template view.phtml file directly then you will not have this problem.

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('macguffin')->toHtml() ; ?>

Where macguffin is your block.

You can also pull through your block title with a bit more code:

<?php $block = Mage::getModel('cms/block')->setStoreId(Mage::app()->getStore()->getId())    ->load('macguffin');
echo "<h3>".$block->getTitle()."</h3>"; ?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜