1

I have title suffix in magento 1.7 system configuration.

I would like to remove title suffix from all cms pages or from cms pages besides home page.

How to do this?

2

IN file:

  app/design/frontend/{theme}/template/page/html/head.phtml

search:

<title><?php echo $this->getTitle() ?></title>

In place of it put below code and test:

<?php if($this->getRequest()->getModuleName() =='cms' && Mage::getSingleton('cms/page')->getIdentifier()!='home') { ?>
      <?php 
      $prefix = Mage::getStoreConfig('design/head/title_suffix');
      $title = $this->getTitle();
      $processedTitle = trim(substr($title, 0, strpos($title, $prefix)));
      ?>
      <title><?php echo $processedTitle; ?></title>
 <?php } else {?>
      <title><?php echo $this->getTitle() ?></title>
 <?php }?>
  • Thanx! Great work! – samdecks Aug 8 '16 at 9:38
  • @samdecks if it works for you, you can accept the answer by clicking on above button. – Baby in Magento Aug 8 '16 at 9:39
  • @samdecks if above code works for you, you can accept the answer. – Chirag Rajput Aug 9 '16 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.