Forums / Templates, Stylesheets, Page Layout / Define Custom Page Titles for Individual Pages - not custom titles for site wide use

Define Custom Page Titles for Individual Pages - not custom titles for site wide use

Locked

Views: 6,508

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
15 May 2008, 1:47 PM
#1
antonyx avatar

antonyx

New Zenner

Join Date:
Mar 2008
Posts:
20
Plugin Contributions:
0

Define Custom Page Titles for Individual Pages - not custom titles for site wide use

hi, i have spent the good part of 2 hours this afternoon researching custom page titles in Zen Cart.

i understand that in order to use custom page title tags (<title>) you need to create a folder in the *includes\languages\english* directory and create a meta_tags.php file in that folder

i have managed to do this and i have successfully set up a custom page title that is displayed on all of my pages. GREAT!

the only problem now however is that i want a different page title for each one of my pages..

lets take the following two pages for example..

Homepage - index.php

Contact Us page - contact_us.html

within my newly created meta_tags.php file, how can i create a custom page title specific to an individual page

would i need add the following (or something resembling this..) to my meta_tags.php page:

define('INDEX_PAGE_TITLE', 'Mysite.com - Home Page - Browser our products');
define('CONTACT_US_TITLE', 'Mysite.com - Contact Us - Tell us your thoughts');

or do i have to locate the actual page file itself and edit something there..

someone please please help me.. im desperate, someone MUST know what i am going on about.. PLEASE!!!

15 May 2008, 11:30 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Define Custom Page Titles for Individual Pages - not custom titles for site wide use

What exactly do you not like about what it currently produces for your page title?
If you want "Contact Us" display differently, then just update the page name in your contact_us.php language file (and save it in your custom override folder). It seems you may be making it more complicated than you need to.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

16 May 2008, 8:39 AM
#3
antonyx avatar

antonyx

New Zenner

Join Date:
Mar 2008
Posts:
20
Plugin Contributions:
0

Re: Define Custom Page Titles for Individual Pages - not custom titles for site wide use

hi, thanks very much for the reply, it is much appreciated.

the example i gave seems a bit silly i know.

the reason i require unique page titles is for seo. the majority of my pages on my site do have unique page titles (products, categories..) which i have edited using the custom meta tags function.

i still however needed to edit the top level pages because currently they are displaying the generic template which is bad for seo.

i would appreciate you guiding me through this..

i have located my contact page, it is in the following directory

includes\languages\english

here is the page code

<?php
/**
 * @package languageDefines
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: contact_us.php 3149 2006-03-10 07:29:34Z birdbrain $
 */

define('HEADING_TITLE', 'Contact Us');
define('NAVBAR_TITLE', 'Contact Us');
define('TEXT_SUCCESS', 'Your message has been successfully sent.');
define('EMAIL_SUBJECT', 'Message from ' . STORE_NAME);

define('ENTRY_NAME', 'Full Name:');
define('ENTRY_EMAIL', 'Email Address:');
define('ENTRY_ENQUIRY', 'Message:');

define('SEND_TO_TEXT','Send Email To:');
define('ENTRY_EMAIL_NAME_CHECK_ERROR','Sorry, is your name correct? Our system requires a minimum of ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters. Please try again.');
define('ENTRY_EMAIL_CONTENT_CHECK_ERROR','Did you forget your message? We would like to hear from you. You can type your comments in the text area below.');
?>

i have added a define title like so..

<?php
/**
 * @package languageDefines
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: contact_us.php 3149 2006-03-10 07:29:34Z birdbrain $
 */

[b]define('TITLE', 'Contact Us Here');[/b]
define('HEADING_TITLE', 'Contact Us');
define('NAVBAR_TITLE', 'Contact Us');
define('TEXT_SUCCESS', 'Your message has been successfully sent.');
define('EMAIL_SUBJECT', 'Message from ' . STORE_NAME);

define('ENTRY_NAME', 'Full Name:');
define('ENTRY_EMAIL', 'Email Address:');
define('ENTRY_ENQUIRY', 'Message:');

define('SEND_TO_TEXT','Send Email To:');
define('ENTRY_EMAIL_NAME_CHECK_ERROR','Sorry, is your name correct? Our system requires a minimum of ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters. Please try again.');
define('ENTRY_EMAIL_CONTENT_CHECK_ERROR','Did you forget your message? We would like to hear from you. You can type your comments in the text area below.');
?>

i have then saved a copy of this contact_us.php file in my custom template folder which is currently includes\languages\english\freefall

i have uploaded everything and the Contact Us page is still taking the generic title stated in my includes\languages\english\freefall\meta_tags.php file.

can you see what i am doing wrong?

16 May 2008, 1:50 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Define Custom Page Titles for Individual Pages - not custom titles for site wide use

Try changing a definition that's actually used by the code, such as:```
define('NAVBAR_TITLE', 'Contact Us');

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

16 May 2008, 4:34 PM
#5
antonyx avatar

antonyx

New Zenner

Join Date:
Mar 2008
Posts:
20
Plugin Contributions:
0

Re: Define Custom Page Titles for Individual Pages - not custom titles for site wide use

hi, yes that does indeed work :)

however, the contact us page is now displaying my custom title AND the generic template in the meta_tags file.

i understand i could delete the generic title altogether and that would solve the problem but how can i retain my generic title but not include it in the contact us title???

17 May 2008, 5:59 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Define Custom Page Titles for Individual Pages - not custom titles for site wide use

Sorry, I don't follow you.

What's the URL where this can be seen?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 May 2008, 8:42 AM
#7
antonyx avatar

antonyx

New Zenner

Join Date:
Mar 2008
Posts:
20
Plugin Contributions:
0

Re: Define Custom Page Titles for Individual Pages - not custom titles for site wide use

thanks a lot for this help. i can show the page, it is here:

http://www.freefalluk.com/contact_us.html

I am able to edit the first part of the title, but the generic words..

Unique Unusual Funny Gifts, Rubber Ducks, Fashion & Lady Handbags, ############## Bag Accessory - FreefallUK

still get added to the title..

19 May 2008, 4:58 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Define Custom Page Titles for Individual Pages - not custom titles for site wide use

Are you saying that you believe that having your site keywords added to the page title is bad for SEO?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 May 2008, 8:32 AM
#9
antonyx avatar

antonyx

New Zenner

Join Date:
Mar 2008
Posts:
20
Plugin Contributions:
0

Re: Define Custom Page Titles for Individual Pages - not custom titles for site wide use

there is no real problem in that

however having the exact same title duplicated on every single page is VERY BAD seo

this is a different issue however, i'm still having trouble removing that generic title from every page. i may just have to delete the generic title altogether and write custom titles for every page.

is that the only way around this?

20 May 2008, 5:35 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Define Custom Page Titles for Individual Pages - not custom titles for site wide use

Zen Cart, out of the box, generates different page titles for every page.

Typically it starts with the page name, followed by your site-defined divider, followed by a site tagline, both defined in your meta_tags.php language file.
Thus, every page is different. Similar yes, but different nonetheless.

Keywords and Description metatags also vary from page to page.

If you're getting identical titles on all pages, then you've broken something somewhere.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.