开发者

Magento - page code question

On my website, I don't want the h1 tag to appear if the page_id == 14.

So in my code below, I added an if statement to this (see below). When I refreshed my page, I got an error saying that page_id can not befound. So I tried the following in my if statement:

if (page_id==14) ....
if (title == 'Welcome to EcoConvenience')....
if (identifier == 'Slideshow-Test')....

and got an error for each one of these.

So how to I get the code to recogni开发者_如何转开发ze any one of these variables from the cms_pages table?

<!-- start center -->
<div id="main" class="col-main">
   <!-- start global messages -->
   <?php echo $this->getChildHtml('global_messages') ?>
   <!-- end global messages -->
   <?php echo $this->getChildHtml('breadcrumbs') ?>
   <div class="page-head">
    <h1><?php 
       if ($page_id = 14)
         { echo Mage::getSingleton('cms/page')->getTitle(); } ?></h1>
 </div>
<!-- start content -->
<?php echo $this->getChildHtml('content') ?>&nbsp;
<!-- end content -->
</div>
<!-- end center -->


Try this!

$pageid = Mage::getBlockSingleton('cms/page')->getPage()->getIdentifier();
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜