Titles on index category pages.
#1
Posted 12 March 2004, 23:59
On the index.php page change the title line to:
<title><?php echo TITLE; ?> <?php echo $categories['categories_name']; ?> Online Catalog</title>
The $categories['categories_name']; var comes from the application top bread crumb trail. When you click through the categories on the index page it puts the category name into the title.
#2
Posted 15 March 2004, 18:46
Steve
PC Planet
#3
Posted 15 March 2004, 18:59
<title><?php echo TITLE; ?> : <?php echo HEADING_TITLE; ?> </title>makes all the other pages take on the page 'title', or rather the text used in the breadcrumb navigation.
#4
Posted 15 March 2004, 19:45
wondernet, on Mar 15 2004, 06:59 PM, said:
<title><?php echo TITLE; ?> : <?php echo HEADING_TITLE; ?> </title>makes all the other pages take on the page 'title', or rather the text used in the breadcrumb navigation.
<title><?php echo TITLE; ?> : <?php echo products_name; ?> </title>
#5
Posted 15 March 2004, 20:03
#6
Posted 17 March 2004, 00:00
http://www.oscommerce.com/community/contributions,207 and then used this code on the page
Quote
$product_info = tep_db_query("select p.products_id, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.language_id = '" . $languages_id . "'");
$product_info_values = tep_db_fetch_array($product_info);
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?> <?php echo $product_info_values['products_head_title_tag']; ?></title>
<meta name="keywords" content="<?php echo $product_info_values['products_head_keywords_ta"]; ?>">
<meta name="description" content="<?php echo $product_info_values['products_head_desc_ta"]; ?>">
on
#7
Posted 18 March 2004, 12:51
I achieved what you are looking for by doing this :
In application_top.php :
Around
Quote
$breadcrumb = new breadcrumb;
Add
Quote
After
Quote
Add
Quote
After
Quote
Add
Quote
Modify the model query to include products_name
Quote
Then after the breadcrumb ->add insert
Quote
Now in both default.php and product_info.php change
Quote
to
Quote
Its good, n'est pas?
#8
Posted 18 March 2004, 13:02
Thanks.
#9
Posted 18 March 2004, 16:03
Cool. I like that one because its soooo simple. Now no one has an excuse for not having a unique title on every page. I see a lot of nice graphic designs on OSC shops, but they have the same title on every page. If you go through the /catalog folder you can work on the titles on other page too.
I went through setting up the header tags controller contrib(above) because I wanted to have precise control on my titles, keyword and description meta tags on the product pages. It was a lot of work to go back through the catalog and set those all up and I don't have a lot of products. This is a great way for someone with a lot of products, who is looking for something quick and dirty to get unique titles. I think it really helps for search engine placement, especially google, to have unique titles. I can find a lot of google searches where my site comes up first or very high when people search for a specific product.
Dan
#10
Posted 18 March 2004, 17:32
Dan,
While I admire your scrupulous attention to detail I rather fear that your hard work may have been in vain as I have it on good authority that few search engines these days use the meta tags during their indexing of your site. This was decided because of gross misuse by porn/viagra peddlers et al. The most recent articles that I have read indicate that the <title></title> tags are used and the page contents parsed for relevance. What is important is that the first few lines/paragraph contain the most relevant information about the page in question. Therefore it is important that you don't put a lot of "textural padding" like a disclaimer at the top of the page but put the most relevant information about your product there.
Hope that is of some assistance.
Regards
Alex.
#11
Posted 20 March 2004, 17:05
Search on Yahoo for: electronic dart boards
Out of the top 4 listings (didn't look further), 1,2 and 4 have the Meta description tag, and that is what Yahoo displays as the description for the result. # 3 doesn't, because they don't have the Meta description at all.
#2 has actually changed their description since Yahoo crawled that pafge, and you'd need to look at the Yahoo cached version to see the description tag actually displayed currently in the results.
So, the Meta description IS a handy way to get the description you want in the search results.
Actually, if you look at those top 4 results, the description of the three with one looks much better than the one without it.
How useful is it actually for ranking? Who knows as Yahoo is a new animal, but Yahoos 'new' search technology will be powering Yahoo Search, AllTheWeb and Altavista, so I wouldn't yet discount that description Meta tag.
#12
Posted 22 March 2004, 03:46
#13
Posted 22 March 2004, 04:52
If so, there is no default.php, it's been renamed to index.php.
#14
Posted 23 March 2004, 20:37
Modify the model query to include products_name
QUOTE
$model_query = tep_db_query("select p.products_model, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.language_id = '" . $languages_id . "'");
Then after the breadcrumb ->add insert
QUOTE
$page_title = $model['products_name'];
Can you explain these 2 steps a little for me?
#15
Posted 24 March 2004, 11:23
The breadcrumb trail is an object which is populated with values by calling the method called "add", search for the string "breadcrumb->add". You should add the new code "$page_title = $model['products_name'];" after this line.
Hope that helps.
(don't add the double-quotes, I just added those for annotation purposes)
Regards
Alex.
#16
Posted 25 March 2004, 13:28
Quote
#17
Posted 25 March 2004, 19:26
QUOTE
$page_title = $model['products_name'];
Now in both default.php and product_info.php change
QUOTE
<title><?php echo TITLE; ?></title>
to
QUOTE
<title><?php echo TITLE; ?> - <?php echo $page_title; ?></title>
Thanks
SeminoleFan
#18
Posted 25 March 2004, 22:11
<!-- Page layout by Simple Template System (STS) v2.01 on osCommerce 2.2-MS2 - http://www.diamondsea.com/sts/ -->
<!-- Using Template File [includes/sts_template.html) -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- BOF: Generated Meta Tags -->
<title> Find Barcode Labels, Barcode Printers, Thermal Transfer Labels and Zebra Printers Here! </title>
<META NAME="Description" Content="Purchase Barcode Printers, Barcode Labels, Thermal Transfer Labels, and Zebra Printers at AdaZon. ">
<META NAME="Keywords" CONTENT=" barcode printers, barcode labels, zebra printers, thermal transfer labels, thermal transfer printers, barcode scanners, Sato printers, datamax printers, intermec scanners, symbol scanners, thermal transfer ribbons, barcode ribbons">
<!-- EOF: Generated Meta Tags -->
I have 2 contributions added. One is STS and the other is Header Tag Controller. The title><title has an unwanted space in front and behind the actual words. I cannot get rid of them. I also want the title to be right under the <head> Is that possible?
#19
Posted 29 March 2004, 19:39
I achieved what you are looking for by doing this :
In application_top.php :
Around
[quote]require(DIR_WS_CLASSES . 'breadcrumb.php');
$breadcrumb = new breadcrumb;[/quote]
Add
[quote]$page_title = '';[/quote]
After
[quote]$breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));[/quote]
Add
[quote]$page_title = $categories['categories_name'];[/quote]
After
[quote]$breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']));[/quote]
Add
[quote]$page_title = $manufacturers['manufacturers_name'];[/quote]
Modify the model query to include products_name
[quote]$model_query = tep_db_query("select p.products_model, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.language_id = '" . $languages_id . "'");[/quote]
Then after the breadcrumb ->add insert
[quote]$page_title = $model['products_name'];[/quote]
Now in both default.php and product_info.php change
[quote]<title><?php echo TITLE; ?></title>[/quote]
to
[quote]<title><?php echo TITLE; ?> - <?php echo $page_title; ?></title>[/quote]
Its good, n'est pas? [/quote]
Hello,
I am using ms2 max can you tell me where I would find this in ms2 max
Now in both default.php and product_info.php change
[quote]<title><?php echo TITLE; ?></title>[/quote]
to
[quote]<title><?php echo TITLE; ?> - <?php echo $page_title; ?></title>[/quote]
I looked in the index.php and product_info.php and cannot find this.
Thank you
#20
Posted 31 March 2004, 00:10
In order to fix this, make the following small changes:
Whereever you added $page_title, such as
Quote
Quote
Quote
Quote
This way, the hyphen is part of the variable, and isn't displayed when not needed.
-Ethan
Edited by Ethan1701, 31 March 2004, 00:10.














