How do I create a default category meta title for all the category pages?
I would like it to be something like this:
<title>{{category name}} - blah blah blah blah</title>
I want it to be the default only for category pages.
Is this possible?
categorymeta-title
How do I create a default category meta title for all the category pages?
I would like it to be something like this:
<title>{{category name}} - blah blah blah blah</title>
I want it to be the default only for category pages.
Is this possible?
Best Answer
Add the following code in your
head.phtml
EDIT
As far as I know
Mage::registry('current_category')
can be used to check whether we are in a category. See Alanstorm's Answer. The important parts of that answer is adding below for referenceCurrent versions of Magento register certain global variables (not PHP globals, but things global to the Magento system) on certain pages.
Calling the following
will either return null if the objects haven't been set (i.e. you're on a page without a category or a product), or return category and product objects.
If a product object is returned you're on a product page.
If no product object is returned but a category object is, you're on a category page.
then you can print what you want.