Jump to content
Sign in to follow this  
suhy

META Tags on the Fly

Recommended Posts

Hi Bill,

 

Appreciate your support, thank you

 

I did replace back the code as you suggested in both files :

 

catalog/languages/english.php

And

catalog/admin/languages/english.php

 

now it is

 

// page title

define('TITLE', STORE_NAME);

 

Went back to meta tag analyzer http://www.widexl.com/remote/search-engine...g-analyzer.html but the results are the same.

 

Can you kindly have another look at the site

http://www.qazamart.com

 

Best regards

Ahmed

 

 

Apologies, I wrote the wrong files path, it suppose to be as following:

 

It was in catalog/includes/languages/english.php

And catalog/admin/includes/languages/english.php

Share this post


Link to post
Share on other sites

Ok I think I may have found the problem.

When I view the source for your page I see this

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

</head>

<body>

</body>

</html><!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html dir="LTR" lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<TITLE>QazaMart Ebooks Store</TITLE>

<META NAME="Keywords" content="digital ebook. ebook reader, work at home, affiliate, make money online, home based business, download software">

<META NAME="Description" content="work at home sell ebooks and generate a good revenue with english and arabic ebooks and download free ebooks">

 

Notice the part in bold is extra and duplicated

Look at catalog/index.php and delete the part in bold


My Contributions

 

Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly

Password Protect Admin

"No matter where you go....There you are" - Buccaroo Bonsai

Share this post


Link to post
Share on other sites
Ok I think I may have found the problem.

When I view the source for your page I see this

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

</head>

<body>

</body>

</html><!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html dir="LTR" lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<TITLE>QazaMart Ebooks Store</TITLE>

<META NAME="Keywords" content="digital ebook. ebook reader, work at home, affiliate, make money online, home based business, download software">

<META NAME="Description" content="work at home sell ebooks and generate a good revenue with english and arabic ebooks and download free ebooks">

 

Notice the part in bold is extra and duplicated

Look at catalog/index.php and delete the part in bold

 

 

 

Hi Bill,

 

Thanks for the assistance.

 

When I viewed the page source I saw the same as yours which was available at the beginning of the page :

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

</head>

<body>

</body>

</html><!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html dir="LTR" lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

 

BUT, at the catalog/index.php the code is not repeated as shawn below :

 

<?php

/*

$Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

// the following cPath references come from application_top.php

$category_depth = 'top';

if (isset($cPath) && tep_not_null($cPath)) {

$categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");

$cateqories_products = tep_db_fetch_array($categories_products_query);

if ($cateqories_products['total'] > 0) {

$category_depth = 'products'; // display products

} else {

$category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");

$category_parent = tep_db_fetch_array($category_parent_query);

if ($category_parent['total'] > 0) {

$category_depth = 'nested'; // navigate through the categories

} else {

$category_depth = 'products'; // category has no products, but display the 'no products' message

}

}

}

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

?>

<!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 $titletag; ?></TITLE>

<META NAME="Keywords" content="<?php echo $keywordtag; ?>">

<META NAME="Description" content="<?php if (tep_not_null($cat_description['categories_description'])){

 

 

Could that be in another file ?

 

Thanks for your help

Regards

Ahmed

Share this post


Link to post
Share on other sites

Possibly in catalog/includes/application_top.php

only a guess as that is the only file that is called prior to the head tag

wait there is one more

catalog/includes/languages/english/index.php

try looking in those


My Contributions

 

Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly

Password Protect Admin

"No matter where you go....There you are" - Buccaroo Bonsai

Share this post


Link to post
Share on other sites
Possibly in catalog/includes/application_top.php

only a guess as that is the only file that is called prior to the head tag

wait there is one more

catalog/includes/languages/english/index.php

try looking in those

 

 

 

 

Bill,

 

I think you have found it.

 

There is nothing in catalog/includes/application_top.php

 

But below is the content of catalog/includes/languages/english/index.php

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

</head>

<body>

<?php /*

$Id: index.php,v 1.1 2003/06/11 17:38:00 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

Copyright © 2003 osCommerce

Released under the GNU General Public License

*/

define('TEXT_MAIN', '');

define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');

define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');

define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {

define('HEADING_TITLE', 'Products');

define('TABLE_HEADING_IMAGE', '');

define('TABLE_HEADING_MODEL', 'Model');

define('TABLE_HEADING_PRODUCTS', 'Product Name');

define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');

define('TABLE_HEADING_QUANTITY', 'Quantity');

define('TABLE_HEADING_PRICE', 'Price');

define('TABLE_HEADING_WEIGHT', 'Weight');

define('TABLE_HEADING_BUY_NOW', 'Buy Now');

define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');

define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');

define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');

define('TEXT_SHOW', '<b>Show:</b>');

define('TEXT_BUY', 'Buy 1 \'');

define('TEXT_NOW', '\' now');

define('TEXT_ALL_CATEGORIES', 'All Categories');

define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');

} elseif ($category_depth == 'top') {

define('HEADING_TITLE', 'Hello');

} elseif ($category_depth == 'nested') {

define('HEADING_TITLE', 'Categories');

}

?>

</body>

</html>

 

Hope it is this one, do I delete those lines ?

 

Much obliged

Regards

Ahmed

Share this post


Link to post
Share on other sites

Yes delete this part at the top

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

</head>

<body>

 

 

and this at the end

</body>

</html>

Be sure afterwards that the index page loads correctly. If this was a template we may need to do some additional coding


My Contributions

 

Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly

Password Protect Admin

"No matter where you go....There you are" - Buccaroo Bonsai

Share this post


Link to post
Share on other sites
Yes delete this part at the top

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

</head>

<body>

and this at the end

</body>

</html>

Be sure afterwards that the index page loads correctly. If this was a template we may need to do some additional coding

 

 

 

Bill,

 

YOU DID IT

 

Al last I could see The store title, I don’t know if there is a side effect, we will know that in the days to come.

 

Thank you very much for your great efforts, assistance and guidance.

Best wishes

Ahmed

Share this post


Link to post
Share on other sites

Hi All!

I use the Simple Template System for one of the shops and I can't get this Meta tags on the fly contribution work...

There's a few lines in includes/classes/sts.php that handles the header if your using STS.

	// Load up the <head> content that we need to link up everything correctly.  Append to anything that may have been set in sts_user_code.php
// Note that since v3.0, stylesheet is not defined here but in the template file, allowing different stylesheet for different template.
   $this->template['headcontent'] = $this->template['headcontent'].'';
   $this->template['headcontent'] = $this->template['headcontent'].'<meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET . '">' . "\n"; 
   $this->template['headcontent'] = $this->template['headcontent'].$this->template['headertags']. "\n"; ;
   $this->template['headcontent'] = $this->template['headcontent'].'<base href="' . (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG . '">' . "\n";
   $this->template['headcontent'] = $this->template['headcontent'].get_javascript($this->template['applicationtop2header'],'get_javascript(applicationtop2header)');

What should I do to make it work with META tags on the fly...

Anonone?

//Micke

Share this post


Link to post
Share on other sites

First of all thanks for a great contribution, I have installed this and it works great for the title and keyword tags, I am just geting a blank for description tags though for my product pages. The index page is fine. Any idea?

Share this post


Link to post
Share on other sites
Hi All!

I use the Simple Template System for one of the shops and I can't get this Meta tags on the fly contribution work...

There's a few lines in includes/classes/sts.php that handles the header if your using STS.

	// Load up the <head> content that we need to link up everything correctly.  Append to anything that may have been set in sts_user_code.php
// Note that since v3.0, stylesheet is not defined here but in the template file, allowing different stylesheet for different template.
   $this->template['headcontent'] = $this->template['headcontent'].'';
   $this->template['headcontent'] = $this->template['headcontent'].'<meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET . '">' . "\n"; 
   $this->template['headcontent'] = $this->template['headcontent'].$this->template['headertags']. "\n"; ;
   $this->template['headcontent'] = $this->template['headcontent'].'<base href="' . (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG . '">' . "\n";
   $this->template['headcontent'] = $this->template['headcontent'].get_javascript($this->template['applicationtop2header'],'get_javascript(applicationtop2header)');

What should I do to make it work with META tags on the fly...

Anonone?

//Micke

 

Hi Micke

 

Did you manage to solve your STS problem, I'm having the same problem and can't work out where to fix it. Let me know if you have.

 

Mark

Share this post


Link to post
Share on other sites

Hi All!

Please post your solution for the STS with Meta tags on the Fly contrib.
Got no solution yet...

//Micke

Share this post


Link to post
Share on other sites

Hi All! (especially "wormington" & "nextprevious")

Sorry for the delay... Here's the STS/Metatag on the fly solution:

 

In catalog/includes/modules/sts_inc/general.php:

Find the line that goes:

$sts->template['headertags']= "<title>" . TITLE ."</title>";

change that line to this chunk of code:

//  BOF Header Tags on the fly adaption - Micke
//  $sts->template['headertags']= "<title>" . TITLE ."</title>";
$sts->template['headertags']= "<title>" . $titletag ."</title>";
$sts->template['keywordtags']= "<META NAME=\"Keywords\" content=\"" . $keywordtag . "\">" . "\n";

if (tep_not_null($cat_description['categories_description'])){
$sts->template['descriptiontags']= "<META NAME=\"Description\" content=\"" . (strip_tags($cat_description['categories_description'])) . "\">" . "\n";
} else { 	
$sts->template['descriptiontags']= "<META NAME=\"Description\" content=\"" . $description . "\">" . "\n";
}	
//  EOF Header Tags on the fly adaption - Micke

Save, close and upload catalog/includes/modules/sts_inc/general.php

 

In catalog/includes/classes/sts.php:

Find the line that goes:

	$this->template['headcontent'] = $this->template['headcontent'].$this->template['headertags']. "\n";;

add under that line this chunk of code:

//  BOF Header Tags on the fly adaption - Micke 	
$this->template['headcontent'] = $this->template['headcontent'].$this->template['keywordtags']. "\n";;
$this->template['headcontent'] = $this->template['headcontent'].$this->template['descriptiontags']. "\n";;
//  EOF Header Tags on the fly adaption - Micke

Save, close and upload catalog/includes/classes/sts.php

Your'e done!

//Micke

Share this post


Link to post
Share on other sites

Hey Micke Thank you for posting your solution!

 

I installed the META Tags on the Fly contrib and made your code modifications to work with STS.

 

Despite my best efforts I have two problems:

 

1) My product_info.php pages show "HEADING_TITLE" in the title along with my store name.

 

2) The Admin > Configuration > Meta Tags shows the admin template (as usual) but nothing about META tags.

I have phpMyAmdin so I can edit the database values for the default keywords and description. Here is the screenshot:

29qhbnb.jpg

 

Thanks.

Edited by nextprevious

Share this post


Link to post
Share on other sites

Okay so I looked at the source of my product_info.php page and the META NAME="Keywords" and META NAME="Description" tags have the correct product information. Just it says "Add your Keywords" in the <META NAME="Keywords" tag. The title still has the "HEADING_TITLE" before my store name. I dont see any "error messages" anywhere...

 

Thank you for your help.

Edited by nextprevious

Share this post


Link to post
Share on other sites

GOOD NEWS!!!

 

The catalog side works fine now. (though still not sure about the Admin side being blank)

The "HEADING_TITLE" problem was my error with another mod.

I changed the default keywords and description directly in the database with phpMyAdmin.

 

I wanted the title and keyword meta tags to be differently configured.

I wanted

Title: Product Name - Category Name (if not product page then default store title)

Keywords: Prodcut Name, category name, default keywords (if not product page then default keywords)

Description: Product description (if not product page the default description)

 

Here is how I did it:

After installing the META tags on the Fly contrib

 

Open catalog/includes/application_top.php

 

Find about line 495:

// BOF Meta tags on the fly///
// include the breadcrumb class and start the breadcrumb trail with mata tags

 require(DIR_WS_CLASSES . 'breadcrumb.php');
 $breadcrumb = new breadcrumb;
$titletag = TITLE;
$keywordtag = KEYWORD_TAG;
$description = DESCRIPTION_TAG;
$seperator = '-';
$keywordsep = ', ';
 $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
 $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));

// add category names or the manufacturer name to the breadcrumb trail
 if (isset($cPath_array)) {
for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
  $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");
  if (tep_db_num_rows($categories_query) > 0) {
	$categories = tep_db_fetch_array($categories_query);
	$breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
$titletag .= $seperator . $categories['categories_name'];
$keywordtag .= $keywordsep . $categories['categories_name'];  
  } else {
	break;
  }
}
 } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) {
$manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
if (tep_db_num_rows($manufacturers_query)) {
  $manufacturers = tep_db_fetch_array($manufacturers_query);
  $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']));
$titletag .= $seperator . $manufacturers['manufacturers_name'];
$keywordtag .= $keywordsep . $manufacturers['manufacturers_name'];
}
 }

// add the products name to the breadcrumb trail
 if (isset($HTTP_GET_VARS['products_id'])) {
$name_query = tep_db_query("select products_name, products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] ."' and language_id = '" . (int)$languages_id . "'");

if (tep_db_num_rows($name_query)) {
  $name = tep_db_fetch_array($name_query);
$breadcrumb->add($name['products_name'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));
$keywordtag .= $keywordsep . $name['products_name'];
$titletag .= $seperator;
$titletag .= substr(preg_replace('[^a-zA-Z0-9]',' ',(strip_tags($name['products_name']))),0,100);  
$description = substr(preg_replace('[^a-zA-Z0-9]',' ',(strip_tags($name['products_description']))),0,300);
// In above code change 300 to the length you want the description tag to be.
 }
 }
//// EOF Metatags on the fly//////

 

 

AND REPLACE WITH:

// BOF Meta tags on the fly///
// include the breadcrumb class and start the breadcrumb trail with mata tags

 require(DIR_WS_CLASSES . 'breadcrumb.php');
 $breadcrumb = new breadcrumb;
$titletag = "";
$keywordtag = "";
$description = "";
$seperator = ' - ';
$keywordsep = ', ';
 $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
 $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));

// add category names or the manufacturer name to the breadcrumb trail
 if (isset($cPath_array)) {
for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
  $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");
  if (tep_db_num_rows($categories_query) > 0) {
	$categories = tep_db_fetch_array($categories_query);
	$breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));  
  } else {
	break;
  }
}
 } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) {
$manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
if (tep_db_num_rows($manufacturers_query)) {
  $manufacturers = tep_db_fetch_array($manufacturers_query);
  $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']));
//	$titletag .= $seperator . $manufacturers['manufacturers_name'];
$keywordtag .= $keywordsep . $manufacturers['manufacturers_name'];
}
 }


// add the products name to the breadcrumb trail
 if (isset($HTTP_GET_VARS['products_id'])) {
$name_query = tep_db_query("select products_name, products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] ."' and language_id = '" . (int)$languages_id . "'");

if (tep_db_num_rows($name_query)) {
  $name = tep_db_fetch_array($name_query);
$breadcrumb->add($name['products_name'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));
$keywordtag .= $name['products_name'];
$keywordtag .= $keywordsep . $categories['categories_name'];  
$keywordtag .= $keywordsep . KEYWORD_TAG;
$titletag .= substr(preg_replace('[^a-zA-Z0-9]',' ',(strip_tags($name['products_name']))),0,100);  
$titletag .= $seperator . $categories['categories_name'];
$description = substr(preg_replace('[^a-zA-Z0-9]',' ',(strip_tags($name['products_description']))),0,300);
// In above code change 300 to the length you want the description tag to be.
 }
 } 
// If values are not defined then set them to default
 if ($titletag == "") { $titletag = TITLE;}
 if ($keywordtag == "") { $keywordtag = KEYWORD_TAG;}
 if ($description == "") { $description = DESCRIPTION_TAG;}

 //// EOF Metatags on the fly//////

Edited by nextprevious

Share this post


Link to post
Share on other sites

How would I add the last breadcrumb to the title?

 

So the login page breadcrumbs:

Top » Catalog » Login

 

How to add the "Login" to the title?

 

For the shopping cart page:

Top » Catalog » Cart Contents

 

How to add "Cart Contents" to the page title?

 

I would want to code it in catalog/includes/application_top.php

So instead of setting it to default TITLE I would put the last breadcrumb in the title.

 

// If values are not defined then set them to default
 if ($titletag == "") { $titletag = TITLE;}
 if ($keywordtag == "") { $keywordtag = KEYWORD_TAG;}
 if ($description == "") { $description = DESCRIPTION_TAG;}

 //// EOF Metatags on the fly//////

 

I would also like to add it to the other meta tags too.

 

Thank you.

Share this post


Link to post
Share on other sites
Hi All! (especially "wormington" & "nextprevious")

Sorry for the delay... Here's the STS/Metatag on the fly solution:

 

In catalog/includes/modules/sts_inc/general.php:

Find the line that goes:

$sts->template['headertags']= "<title>" . TITLE ."</title>";

change that line to this chunk of code:

//  BOF Header Tags on the fly adaption - Micke
//  $sts->template['headertags']= "<title>" . TITLE ."</title>";
$sts->template['headertags']= "<title>" . $titletag ."</title>";
$sts->template['keywordtags']= "<META NAME=\"Keywords\" content=\"" . $keywordtag . "\">" . "\n";

if (tep_not_null($cat_description['categories_description'])){
$sts->template['descriptiontags']= "<META NAME=\"Description\" content=\"" . (strip_tags($cat_description['categories_description'])) . "\">" . "\n";
} else { 	
$sts->template['descriptiontags']= "<META NAME=\"Description\" content=\"" . $description . "\">" . "\n";
}	
//  EOF Header Tags on the fly adaption - Micke

Save, close and upload catalog/includes/modules/sts_inc/general.php

 

In catalog/includes/classes/sts.php:

Find the line that goes:

	$this->template['headcontent'] = $this->template['headcontent'].$this->template['headertags']. "\n";;

add under that line this chunk of code:

//  BOF Header Tags on the fly adaption - Micke 	
$this->template['headcontent'] = $this->template['headcontent'].$this->template['keywordtags']. "\n";;
$this->template['headcontent'] = $this->template['headcontent'].$this->template['descriptiontags']. "\n";;
//  EOF Header Tags on the fly adaption - Micke

Save, close and upload catalog/includes/classes/sts.php

Your'e done!

//Micke

 

Thanks Micke, you're a star

 

Mark

Share this post


Link to post
Share on other sites

Okay I got it.

 

Example for login.php:

Page title: Login - Store Name

 

Example for create_account.php:

Page title: Create Account - Store Name

 

This code also adds the page name to the keyword and description meta tags.

 

Here is how to do it for anyone else:

 

After installing the META Tags on the fly contrib

Note: If you are using STS (Simple Template System) make this modification too.

 

1) Create a new file in catalog/includes/ and name it check_meta.php with this code:

<?php
if (NAVBAR_TITLE != "NAVBAR_TITLE"){
$page_title = NAVBAR_TITLE  . " - ";
$page_keyword = NAVBAR_TITLE  . ", ";
$page_desc = NAVBAR_TITLE  . " ";
} else {
$page_title = "";
$page_keyword = "";
$page_desc = "";
}

// If META values are not defined then set them
 if ($titletag == "") { $titletag = $page_title . TITLE;}
 if ($keywordtag == "") { $keywordtag = $page_keyword . KEYWORD_TAG;}
 if ($description == "") { $description = $page_desc . DESCRIPTION_TAG;}
?>

 

2) In catalog/login.php

Find

<html <?php echo HTML_PARAMS; ?>>

and ABOVE it add:

<?php include(DIR_WS_INCLUDES . 'check_meta.php'); ?>

 

3) Upload the catalog/includes/check_meta.php and catalog/login.php

 

Repeat step 2 and 3 for any pages in the /catalog/ folder you would like the page title to include the last breadcrumb.

 

Thats it.

 

I am also using this mod for the following layout:

Title: Product Name - Category Name (if not product page then breadcrumb and default store title)

Keywords: Prodcut Name, category name, default keywords (if not product page then default keywords)

Description: Product description (if not product page the default description)

 

How would I add the last breadcrumb to the title?

 

So the login page breadcrumbs:

Top » Catalog » Login

 

How to add the "Login" to the title?

 

For the shopping cart page:

Top » Catalog » Cart Contents

 

How to add "Cart Contents" to the page title?

 

I would want to code it in catalog/includes/application_top.php

So instead of setting it to default TITLE I would put the last breadcrumb in the title.

 

// If values are not defined then set them to default
 if ($titletag == "") { $titletag = TITLE;}
 if ($keywordtag == "") { $keywordtag = KEYWORD_TAG;}
 if ($description == "") { $description = DESCRIPTION_TAG;}

 //// EOF Metatags on the fly//////

 

I would also like to add it to the other meta tags too.

 

Thank you.

Share this post


Link to post
Share on other sites

Any suggestions as to why I am not getting the Admin part of this to show up? It is not being listed in the Configuration area of the Admin menu, or anywhere else for that matter. The code in the pages seems to be working, however.

Share this post


Link to post
Share on other sites

Any suggestions as to why I am not getting the Admin part of this to show up? It is not being listed in the Configuration area of the Admin menu, or anywhere else for that matter. The code in the pages seems to be working, however, to a point ....

 

Index.php

<TITLE>NewHomeFitness Online Store</TITLE>
<META NAME="Keywords" content="KEYWORD_TAG">
<META NAME="Description" content="DESCRIPTION_TAG">

 

For categories ....

<TITLE>NewHomeFitness Online Store-Ellipticals</TITLE>
<META NAME="Keywords" content="KEYWORD_TAG, Ellipticals">
<META NAME="Description" content="DESCRIPTION_TAG">

 

For products ....

<TITLE>NewHomeFitness Online Store-Ellipticals-E70 Elliptical</TITLE>
<META NAME="Keywords" content="KEYWORD_TAG, Ellipticals, E70 Elliptical">
<META NAME="Description" content="THE ELLIPTICAL THAT COMES FULL CIRCLE.	Design and engineering come together in this unique masterpiece of exercise technology. This professional-level elliptical machine includes self-generating power and eight built-in programs with 16 levels of resistance. Feedback includes time, work level, wa">

Share this post


Link to post
Share on other sites

Webline,

 

You have to run the SQL in the install package in phpMyAdmin.

When you do so, the there will be an item in the Configuration menu called "Meta Tags".

This is where you fill out Default keywords and Default description.

That's all there is in this contribution in the Admin area.

 

//Micke

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×