Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2008
    Posts
    20
    Plugin Contributions
    0

    Default 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:

    Code:
    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!!!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

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

    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.

  3. #3
    Join Date
    Mar 2008
    Posts
    20
    Plugin Contributions
    0

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

    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

    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..

    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('TITLE', 'Contact Us Here');
    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?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

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

    Try changing a definition that's actually used by the code, such as:
    Code:
    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.

  5. #5
    Join Date
    Mar 2008
    Posts
    20
    Plugin Contributions
    0

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

    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???

  6. #6
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

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

    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.

  7. #7
    Join Date
    Mar 2008
    Posts
    20
    Plugin Contributions
    0

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

    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 &amp; Lady Handbags, ############## Bag Accessory - FreefallUK

    still get added to the title..

  8. #8
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

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

    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.

  9. #9
    Join Date
    Mar 2008
    Posts
    20
    Plugin Contributions
    0

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

    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?

  10. #10
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

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

    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.

 

 

Similar Threads

  1. custom page titles for Manufacturer pages autogenerated using Manufacurer ID
    By antonyx in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 25 Aug 2010, 12:49 PM
  2. Define Page Titles in Admin for Product Categories
    By wolfderby in forum Customization from the Admin
    Replies: 0
    Last Post: 14 Mar 2010, 12:42 AM
  3. Use custom titles/keywords for specific pages?
    By yellow1912 in forum General Questions
    Replies: 5
    Last Post: 22 Mar 2007, 03:12 AM
  4. Custom Dynamic Extra Pages with URL parameters, GET, POST - for Define and EZ Pages
    By bjoly in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 24 Jul 2006, 04:04 AM
  5. Getting custom titles v1.0 to work
    By ctcentralinfo in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 3 Jul 2006, 04:40 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR