Different Title for Product view pages and other pages
-
12-12-2019 - |
Question
I need to have output in a way that all the other pages should get the default title but for product detail page I need a specific title.For this so far I tried adding this code
<h3><?php echo $this->getLayout()->getBlock('head')->getTitle();?></h3>-->>This is for common title
<?php if(Mage::registry('current_product')) ?>
<h3><?php echo "Feaured Products";?></h3>-->>this if for product detail page title.
<?php endif; ?>
but doing in this way crashing my page.
Solution
You forgot a semicolon.
<?php if(Mage::registry('current_product')) ?>
should be
<?php if(Mage::registry('current_product')) : ?>
When developing, turn the error reporting on and the developer mode. This way you get a clear message of what's wrong with your code.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange