PDA

View Full Version : Meta Tag Controller - question



ph
12-22-2004, 04:26 PM
Hi all,

I'm exploring the MS2 MAX package (current) and starting to edit and find out where all the includes are. One big thing I seem to be missing - where exactly is the meta tag controller? Am I supposed to be editing the meta_tag.php file on it's own? Or is there something I'm missing in the admiin section of the backend?

Second question - if the meta controller is just working based off of that meta_tag.php file - has anyone sucessfully removed it and replaced it with a more dynamic mod that would be selected via the admin? Most of my work is heavy code/inc in the past - I'm trying to keep this admin part simple so that if someone else needed to use it - they could.

grin.

Thanks in advance.

michael_s
12-22-2004, 08:16 PM
Actually, what you suggest is LESS dynamic than the current meta tags mod.

The current mod 100% dynamically generates the tags based on the page content. You can manually edit the meta_tags.php file for each and every different page in your site to add whatever you like or modify the tags.

It is actually really simple. Here is a small guide:

in meta_tags.php, the code you are concerned with is :


// Optional customization options for each language
switch ($languages_id) {
// English language
case '1':
//Extra keywords that will be outputted on every page
$mt_extra_keywords = '';
//Descriptive tagline of your web site
$web_site_tagline = TERTIARY_SECTION . '';
break;


I have emphasized in bold the line to add your specific keywords. Enter them between the single quotes, comma separated, like this:


$mt_extra_keywords = 'keyword1,word2,word3';


That will allow you to add your own specific keywords.

Next, to add your own custom text, you can add it to this section:


// Define Primary Section Output
define('PRIMARY_SECTION', ' : ');
define('TITLE', 'AABox Web Hosting');
// Define Secondary Section Output
define('SECONDARY_SECTION', ' - ');


Enter your text inside the single quotes in the areas marked in bold.

This will add keywords and custom text sitewide.

To add customization to single pages, scroll down the meta_tags.php file and edit the individual page settings. For example:



case CONTENT_INDEX_DEFAULT:
define('META_TAG_TITLE', TITLE . PRIMARY_SECTION . HEADING_TITLE . $web_site_tagline);
define('META_TAG_DESCRIPTION', 'custom text here ' . TITLE . PRIMARY_SECTION . HEADING_TITLE . SECONDARY_SECTION . WEB_SITE_KEYWORDS);
define('META_TAG_KEYWORDS', WEB_SITE_KEYWORDS . HEADING_TITLE);
break;

If you place the text in bold in the case CONTENT_INDEX_DEFAULT statement, it will output:

custom text here

on the default index page and all pages that use the default index. Simply add the custom text in whichever case you want to add to. You can place the custom text in any of the defined variables like this:


case CONTENT_INDEX_DEFAULT:
define('META_TAG_TITLE', TITLE . PRIMARY_SECTION . HEADING_TITLE . $web_site_tagline);
define('META_TAG_DESCRIPTION', 'custom text here' . TITLE . PRIMARY_SECTION . HEADING_TITLE . SECONDARY_SECTION . 'custom text here too' . WEB_SITE_KEYWORDS);
define('META_TAG_KEYWORDS', 'custom,keywords,here' . WEB_SITE_KEYWORDS . HEADING_TITLE);
break;

ph
12-23-2004, 02:04 PM
Thanks for the detailed response - I hadn't edited that page too much yet, and now I have more of a map. I thought that the page had a web based editor included in the admin - that's where I stopped before I edited anything (I kept looking for it and searching the code for it).

Thanks!

rwoody
09-23-2005, 02:20 PM
I'm editing the meta_tags_php file and I'm a bit confused. I now have the default index the way I want it, now I'm trying to get the products display the way I want it.

It's a ying/yang...lol Products were working pretty well before the base edits, adding add'l keywords and modifying the title etc. Now all the product info is pushed to the end of the lines and is not the first item as before I began this editing process. So I'm trying to get them back to that point and then improve them.

I seem to have a good understand the dynamic tags and their role, but possiblly I'm not editing the right area for the product display, as no matter what changes I make they are not being reflected when I view the source code.

The area that I am modifying is the "Content_index_products" I'm trying to simply tags when the products are displayed to merely display the category, product description, and price and then list my custom keywords only.

Any englightenment would be helpful. :roll:

Thanks

Sorry Ignore the post and mark it closed... sometimes starting over from scratch is the thing to do. I have it perfect now.

ericcech
11-24-2005, 01:32 PM
Could the rest of us be enlightened? Is it possible to edit for each product?

michael_s
11-24-2005, 07:29 PM
http://oscdox.com/modules.php?op=modload&name=phpWiki&file=index&pag ename=CustomMetatags

ericcech
11-25-2005, 11:28 AM
Yeah, thank you, but I read that. What I'm trying to find is how to define ALL my pages the same way as 'CONTENT_INDEX_DEFAULT' ...I guess I don't understand the format. Can I do the same to individual product pages? Or individual category pages? I got everything else in order - i.e. how to edit each entry, but not how to define the entry for each page.

Cheers,
Eric

michael_s
11-25-2005, 04:13 PM
That is not how the mod works. It dynamically generates the tags for each of the product pages so you do not have to manually do anything. There is no way to do what you are asking with this mod. You would need to install one of the manual meta-tags mods out there...

pefc2525
07-30-2006, 12:50 PM
The meta tags controller does not refresh when i change either a category or product.

Why?

Dumb_Question
10-11-2006, 12:44 PM
if I installed the manual header tags contribution http://www.oscommerce.com/community/contributions,207

would I have to disable dynamic header tags controller...in general which one is better? Ofcourse dynamic is easy to work with

Thank you