Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Displaying category name in browser title


sl1200mk2

Recommended Posts

Posted

First off, I'd like to thank everyone for great advice here. I've followed many of the suggestions and had good results. In reviewing my own site (http://www.onbeatmusic.com) I've determined that I really need to set it up so that when someone clicks a link for a category, the name of that category is shown in the the browsers page title. As with most people, my category names are often my keywords. I noticed that many OSC sites do this.

 

I have yet to figure out how to do this though. I've searched the osc-forums as well as the contributions section. Is there a mod here that I'm missing that anyone could point out? I'm getting good Google listings usually 24-36hrs after I post new products, but I feel this particular mod would greatly help in overall keyword ranking.

 

Some other items I use to help SEO:

 

1. Mod-rewrite to show all links as html (example: http://www.onbeatmusic.com/product145/product_info.html)

 

2. Dynamically changing the product_info page to show the product name in the browser title

 

Any tips someone can offer, especially on the mod I'm looking for would be greatly appreciated.

 

Thank you for your time.

 

Regards,

 

Wayne Lansdowne

Posted

hey wayne,

 

that is a great OSC site! i like the flash header! what font did you use for the logo?

 

about the dynamic title change, steve is right on the money. i use the Header Tag Controller and Dynamic Product Meta Tags by Linda McGrath.

 

-kurt

Posted

Thanks guys,

 

I really appreciate the comments. As far as #2 in my original post, I do use the Dynamic Product Meta Tags (http://www.oscommerce.com/community/contributions,1505) contribution. My product_info pages do use this.

 

I'll try to implement the Header Tag Controller - I guess this is what I'm looking for?

 

Again, my goal is to have the Browser title bar dynamically change to show the category name when some one clicks a category link. I've got the product pages showing correctly! :)

 

Kurt: Thanks for the comments on the Flash.. the font in question is called Digitol. A quick Google search should find it. It's freeware I believe.

 

Thanks again,

 

Wayne

  • 2 weeks later...
Posted

I've found this contribution:

 

http://www.oscommerce.com/community/contri...ons,1176/page,5

 

Only problem is....it mentions adding a title tag but it doesn't.

 

I did some tweaking and got it to add a title as well.

 

Here's what I did:

 

You'll have to add another line to include a field for title in the tep_meta_tags table.

 

CREATE TABLE tep_meta_tags (
meta_id int(11) NOT NULL auto_increment,
category int(5) NOT NULL,
title text NOT NULL,
keywords text NOT NULL,
description text NOT NULL,
PRIMARY KEY (meta_id),
UNIQUE meta_id (meta_id)
);

 

You'll also have to change meta_tags.php to add the title:

 

Here's a copy and paste of mine:

 

<?php
// /catalog/includes/meta_tags.php
// All Original Credit Referred to Tamim - www.TMPanime.com Added: Category Meta Tag Generator v1.0
// Add title, description and keyword meta tags to categories
//
// NOTE: Replace standard default.php meta tags with category specific meta tags
// USE phpMyAdmin to adjust category meta tags / admin tool is in the works
//
// Use you category #(number) and identify it in phpMyadmin / admin tool and subcategories in the works
if ($cPath)
{
$metaCategoryArray = explode ("_",$cPath); // take just the first part of $cPath
$metaCategory = $metaCategoryArray[0];
$category_query = tep_db_query ("select * from tep_meta_tags where category = '" . $metaCategory . "'");


$totalRows = tep_db_num_rows($category_query);
if ($totalRows == 0){
$category_query = tep_db_query ("select * from tep_meta_tags where category = '0'");
}


$metaData = tep_db_fetch_array ($category_query);
$keywords = $metaData ['keywords'];
$description = $metaData ['description'];
$title = $metaData ['title'];

echo '<title>' . $title . '</title>';
echo '<meta name="keywords" content="' . $keywords . '">';
echo '<meta name="description" content="' . $description . '">';
}

// For all other pages (shopping cart, etc.)
else
{
$category_query = tep_db_query ("select * from tep_meta_tags where category = '0'");
$metaData = tep_db_fetch_array ($category_query);
$title = $metaData ['title'];
$keywords = $metaData ['keywords'];
$description = $metaData ['description'];

echo '<title>' . $title . '</title>';
echo '<meta name="keywords" content="' . $keywords . '">';
echo '<meta name="description" content="' . $description . '">';
}

?>

 

Note, not my mode, all credit goes to TAMIM. I just tweeked it to work.

  • 2 weeks later...
  • 3 weeks later...
Posted

How did you convert your pages to html?

 

I would find this really useful!

 

Many thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...