Jump to content



Latest News: (loading..)

* * * * * 1 votes

How to change page titles and headings?


This topic has been archived. This means that you cannot reply to this topic.
28 replies to this topic

#-19   Jack_mcs

Jack_mcs
  • Members
  • 25,318 posts

Posted 27 November 2007 - 05:42 PM

Most new shop masters ask this question and, many times, do it incorrectly. This is meant as a quick quide for how a shops titles and page headings should be handled.  The title is the name that appears in the browser. If you look at the title in your browser now, it will show "osCommerce Community Support Forums." The page heading is the text that is displayed on each page of the site. For the home page, it says "What's New Here?"

Changing the title for the site can be done by editing the includes/languages/english.php file. Locate the following line in that file and change it as you like:
// page title
define('TITLE', 'osCosmmerce');
If you can't find that code, try looking for the following code instead. This is used in the patched versionsof oscommerce and allows the shops title to be set in admin->Configuration.  
define('TITLE', STORE_NAME);

Changing the page headings for the home page and the category pages can be done by editing the includes/languages/index.php file. Look for the lines beginning with
define('HEADING_TITLE',
There will be three such instances.

If you do the above, the title and page heading for your home page will be as you want. But what about your product pages? There is no simple way to change those since the product pages are controlled by one file. The way around this is to install a meta tagscontribution. Most, if not all, of them will allow you to control the titles and page headings for the entire site. This is important since the title is the first thing the search engines look at when entering your site. If it is not setup correctly, the chances of doing well in the search engine listings is reduced.

As far as what to change the title of the home page to, don't make the mistake of choosing the site name. The title should be the same as the main keyword you are targeting for that page. A keyword is some word or phase that someone will search for using a seach engine. It is very rare for the name of the shop to be searched for so by using that as the title, you are hurting your chances of being found by such searches.

Jack

#-18   bdx

bdx
  • Members
  • 14 posts

Posted 04 January 2008 - 08:33 AM

View PostJack_mcs, on Nov 27 2007, 11:42 AM, said:

Most new shop masters ask this question and, many times, do it incorrectly. This is meant as a quick quide for how a shops titles and page headings should be handled.  The title is the name that appears in the browser. If you look at the title in your browser now, it will show "osCommerce Community Support Forums." The page heading is the text that is displayed on each page of the site. For the home page, it says "What's New Here?"

Changing the title for the site can be done by editing the includes/languages/english.php file. Locate the following line in that file and change it as you like:
// page title
define('TITLE', 'osCosmmerce');
If you can't find that code, try looking for the following code instead. This is used in the patched versionsof oscommerce and allows the shops title to be set in admin->Configuration.  
define('TITLE', STORE_NAME);

Changing the page headings for the home page and the category pages can be done by editing the includes/languages/index.php file. Look for the lines beginning with
define('HEADING_TITLE',
There will be three such instances.

If you do the above, the title and page heading for your home page will be as you want. But what about your product pages? There is no simple way to change those since the product pages are controlled by one file. The way around this is to install a meta tagscontribution. Most, if not all, of them will allow you to control the titles and page headings for the entire site. This is important since the title is the first thing the search engines look at when entering your site. If it is not setup correctly, the chances of doing well in the search engine listings is reduced.

As far as what to change the title of the home page to, don't make the mistake of choosing the site name. The title should be the same as the main keyword you are targeting for that page. A keyword is some word or phase that someone will search for using a seach engine. It is very rare for the name of the shop to be searched for so by using that as the title, you are hurting your chances of being found by such searches.

Jack


OOPS!

I found the line define ('TITLE', osCommerce'); and I changed the osCommerce to my stores name and I got the follwing error

Parse error: syntax error, unexpected T_STRING in /home/...../public_html/includes/languages/english.php on line 79

I changed it back to osCommerce and I still get the error. What did I do wrong?

Edited by bdx, 04 January 2008 - 08:39 AM.


#-17   satish

satish
  • Members
  • 5,350 posts

Posted 04 January 2008 - 08:54 AM

You might have placed some special chars or start  and end inverted like 'oscommerce'  might have been missed.

Satish
Ask/Skype for  Free osCommerce value addon/SEO suggestion tips for your site.

Check My About US For who am I and what My company does.

#-16   bdx

bdx
  • Members
  • 14 posts

Posted 04 January 2008 - 09:04 AM

View Postsatish, on Jan 4 2008, 02:54 AM, said:

You might have placed some special chars or start  and end inverted like 'oscommerce'  might have been missed.

Satish


Nope I left everything like it was and only changed the osCommerce th emy store name.the ('...'); remains as is.  ANy other suggestions

#-15   Coopco

Coopco
  • Members
  • 9,557 posts

Posted 04 January 2008 - 09:20 AM

View Postbdx, on Jan 4 2008, 07:33 PM, said:

OOPS!

I found the line define ('TITLE', osCommerce'); and I changed the osCommerce to my stores name and I got the follwing error

Parse error: syntax error, unexpected T_STRING in /home/...../public_html/includes/languages/english.php on line 79

I changed it back to osCommerce and I still get the error. What did I do wrong?
Can you post the offending line?


The Coopco Underwear Shop



If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

#-14   satish

satish
  • Members
  • 5,350 posts

Posted 05 January 2008 - 03:15 AM

do paste your defines.

Its for sure that there is some ' in the text.

Satish
Ask/Skype for  Free osCommerce value addon/SEO suggestion tips for your site.

Check My About US For who am I and what My company does.

#-13   nitehawk

nitehawk
  • Members
  • 6 posts

Posted 24 January 2008 - 03:48 PM

I just did the same thing , changed the texted only and now I as well get the same error. tried to change it back... same error. retyped the line... same thing.. any suggestions as it crashed the site and i would like to get it back.

// charset for web pages and emails
define('CHARSET', 'iso-8859-1');

// page title
define('TITLE', 'osCommerce');

// header text in includes/header.php

this is the line I want to change.. and then changed it back to 'osCommerce'

Edited by nitehawk, 24 January 2008 - 03:50 PM.


#-12   Jack_mcs

Jack_mcs
  • Members
  • 25,318 posts

Posted 24 January 2008 - 06:52 PM

View Postnitehawk, on Jan 24 2008, 10:48 AM, said:

I just did the same thing , changed the texted only and now I as well get the same error. tried to change it back... same error. retyped the line... same thing.. any suggestions as it crashed the site and i would like to get it back.
What error are you seeing?

Jack

#-11   nitehawk

nitehawk
  • Members
  • 6 posts

Posted 24 January 2008 - 09:52 PM

View PostJack_mcs, on Jan 24 2008, 01:52 PM, said:

What error are you seeing?

Jack
Thank-you for looking at my Problem Jack
this is the error that shows when I make the change

Parse error: parse error, unexpected T_STRING in /var/www/vhosts/pegasusproducts.ca/httpdocs/includes/languages/english.php on line 79

When I remove the line completley I error Message moves up one line (78)

This has happened before when I have made changes and I have been able to fix the problem by retypeing the while php file but this one is way to big to retype

thanks for looking
John

#-10   nitehawk

nitehawk
  • Members
  • 6 posts

Posted 24 January 2008 - 11:33 PM

View Postnitehawk, on Jan 24 2008, 04:52 PM, said:

Thank-you for looking at my Problem Jack
this is the error that shows when I make the change

Parse error: parse error, unexpected T_STRING in /var/www/vhosts/pegasusproducts.ca/httpdocs/includes/languages/english.php on line 79

When I remove the line completley I error Message moves up one line (78)

This has happened before when I have made changes and I have been able to fix the problem by retypeing the while php file but this one is way to big to retype

thanks for looking
John

Well seems I fixed my problem. The error was not on the line where i made the change it was actually further down. it seems the for some reason when i made the change i wanted the apostophies (') are not recognized as such. i had to remove the (') in the "what's new" so it now reads "whats new" . does anyone know why and how I can put it back??

#-9   WebSource 5

WebSource 5

    ıllıllı < /> ıllıllı

  • Community Sponsor
  • 474 posts

Posted 24 January 2008 - 11:50 PM

View Postnitehawk, on Jan 24 2008, 05:33 PM, said:

Well seems I fixed my problem. The error was not on the line where i made the change it was actually further down. it seems the for some reason when i made the change i wanted the apostophies (') are not recognized as such. i had to remove the (') in the "what's new" so it now reads "whats new" . does anyone know why and how I can put it back??
you need to put a slash in front of the apostrophie so it should look like this:      what\'s new

#-8   nitehawk

nitehawk
  • Members
  • 6 posts

Posted 24 January 2008 - 11:56 PM

View PostGlcustoms, on Jan 24 2008, 06:50 PM, said:

you need to put a slash in front of the apostrophie so it should look like this:      what\'s new
Thank you ..... it works now ..

I still do not understand why I had the original problem on a line that was half way down the script when all I did was Title change
But it is starting to look good now.

Thanks for the help /i am going to need more as I develop this site nice to know it is here

#-7   diy

diy
  • Members
  • 354 posts

Posted 08 April 2008 - 12:25 PM

I used infromation from oscommercehowto.com which is now down and I managed to change the heading title not only to display the stor name but also the name of the category. But I dont remember how I didi it. Now I checked my index php and i found

on line 68
 <td class="pageHeading"><?php echo $myCategory['categories_name']; ?></td>

on line 234
<td class="pageHeading"><?php echo $myCategory['categories_name']; ?></td>

and on line 292

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

is this what I did to display category name on the title header of the browser????

ps on the original index.php

lines 66-232 and 290 look like

td class="pageHeading"><?php echo HEADING_TITLE; ?></td>


#-6   jonsmithgraphics

jonsmithgraphics
  • Members
  • 21 posts

Posted 03 October 2008 - 04:54 PM

hello
i am building my first oscommerce site and slowly but surely am getting towards where i want to be.

i tried to change the page title in languages/english.php:

define('TITLE', STORE_NAME);

i want the title to be:

define('TITLE', Wooden Toys and Gifts from Toywood);

but if i have more than one word in my title it gives me the error:

Parse error: syntax error, unexpected T_STRING in /homepages/22/d239769018/htdocs/catalog/includes/languages/english.php on line 48

if i just have one word it works fine:

define('TITLE', Toywood);

can anyone tell me what i am doing wrong please?

cheers!! :)

#-5   staceyd

staceyd
  • Members
  • 45 posts

Posted 23 December 2008 - 11:08 PM

Did you ever figure this out?

Is there a reason you wouldn't just change it on the admin page interface?

Otherwise, if you use phpMyAdmin, you can go change it in the configuration table.  In phpMyAdmin, select the configuration table on the left, then click on "browse." You'll see where to change the configuration_value for STORE_NAME on the first line.

Hope this helps someone.  :)

#-4   Jack_mcs

Jack_mcs
  • Members
  • 25,318 posts

Posted 23 December 2008 - 11:39 PM

STORE_NAME is changeable from admin, for some shops, so there shouldn't be a reason to edit the database directly.

Jack

#-3   jonsmithgraphics

jonsmithgraphics
  • Members
  • 21 posts

Posted 06 January 2009 - 03:19 PM

View Postjonsmithgraphics, on Oct 3 2008, 04:54 PM, said:

hello
i am building my first oscommerce site and slowly but surely am getting towards where i want to be.

i tried to change the page title in languages/english.php:

define('TITLE', STORE_NAME);

i want the title to be:

define('TITLE', Wooden Toys and Gifts from Toywood);

but if i have more than one word in my title it gives me the error:

Parse error: syntax error, unexpected T_STRING in /homepages/22/d239769018/htdocs/catalog/includes/languages/english.php on line 48

if i just have one word it works fine:

define('TITLE', Toywood);

can anyone tell me what i am doing wrong please?

cheers!! :)

i fixed this by adding the apostrophes before and after the title as they were missing:

define('TITLE', Toywood);

changed to

define('TITLE', 'Wooden Toys and Gifts from Toywood');

and it seems to work fine!

#-2   Jack_mcs

Jack_mcs
  • Members
  • 25,318 posts

Posted 06 January 2009 - 05:16 PM

View Postjonsmithgraphics, on Jan 6 2009, 10:19 AM, said:

i fixed this by adding the apostrophes before and after the title as they were missing:

define('TITLE', Toywood);

changed to

define('TITLE', 'Wooden Toys and Gifts from Toywood');

and it seems to work fine!
I apologize for not responding to your original post. I missed it somehow. But, yes, your fix is correct. Thanks for posting it.

Jack

#-1   sophiacom

sophiacom
  • Members
  • 6 posts

Posted 17 January 2009 - 01:51 AM

View Postdiy, on Apr 8 2008, 07:25 AM, said:

I used infromation from oscommercehowto.com which is now down and I managed to change the heading title not only to display the stor name but also the name of the category. But I dont remember how I didi it. Now I checked my index php and i found

on line 68
 <td class="pageHeading"><?php echo $myCategory['categories_name']; ?></td>

on line 234
<td class="pageHeading"><?php echo $myCategory['categories_name']; ?></td>

and on line 292

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

is this what I did to display category name on the title header of the browser????

ps on the original index.php

lines 66-232 and 290 look like

td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

This is a great script. It works. Tip: I changed line 290 to
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
also and it worked fine.
One problem exists though, Nested categories do not show a heading text. I will try to add some code to capture that. If it works I will let you know.
sophiacom

#0   S1YF3R

S1YF3R
  • Members
  • 6 posts

Posted 29 January 2009 - 12:21 PM

Thx Jack. Found the title line and changed it. Works like a charm. My client also wanted the title to be changed.

Regards
Chris