Contributions
Display Category Name in Header v1.0
This will display the current category name in the header (or anywhere else for that matter). I use this for SEO (search engine optimization). By default the name of the category is in <H1> tags. I recommend leaving it like this and altering your default <H1> style in stylesheet.css if you don't want the huge text that normally comes with <H1> tags.
I've tested it on subcategories and it appears to work just fine. It also has support for the different languages. There is a default title that it can revert back to if you are not in a category. If you are on a product page, it will still show the name of the category that the product is in. You can see it on all the categories here: www.preciousbedding.com.
| 27 May 2007 |
This is a slight modification to display your store name and category in the page title.
Replace the <TITLE> ... </TITLE> at the top of the index.php file in the main directory with this snippet of code. Replace **NAME OF YOUR STORE** with your stores name. when refreshed, the name of your store plus the category you are in will appear as the page title.
See it in action at www.aftermarketgraphics.com
<title><?php $category_name_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = " . (int)$current_category_id . " and language_id = " . (int)$languages_id);
$category_name = tep_db_fetch_array($category_name_query);
if ((int)$current_category_id <= 0) {echo'**NAME OF YOUR STORE**';}
else echo '**NAME OF YOUR STORE** - ' . $category_name['categories_name']; ?></title>
| 6 Mar 2006 |
Note: Contributions are used at own risk.
