Jump to content
Latest News: (loading..)

Archived

This topic is now archived and is closed to further replies.

Jack_mcs

How to change page titles and headings?

Recommended Posts

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 versions of 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 tags contribution. 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

Share this post


Link to post
Share on other sites
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 versions of 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 tags contribution. 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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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'

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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??

Share this post


Link to post
Share on other sites
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


Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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>

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

 

Jack

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

I want to edit the heading_title cose so that the text will be regular text in a paragraph with capitols and lower case letters without all letters being capitols. How do i do this?

 

~Joe

 

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 versions of 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 tags contribution. 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

Share this post


Link to post
Share on other sites

Do you mean you want to change the case of HEADING_TITLE of its contents. If the former, that is not a good idea. It will work but will make your code non-standard and may cause it to fail at some later date as changes are made, expecting standard code. If you mean the latter, then you just type it in that way. There are ways to do it with code but, again, that is non-standard, and overly complicates matters. If you have a lot of text in upper case, a better approach may be to use the Easy Populate and apply a forumla to change the text.

 

Jack

Share this post


Link to post
Share on other sites

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 versions of 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 tags contribution. 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

 

 

Hi Jack,

 

I change page titles as your advise,and it worked.

 

But when I search our store name "dannovo" by Google,the result is "osCommerce",why and what is the problem?

 

Pls kindly advise,thanks.

Share this post


Link to post
Share on other sites

I change page titles as your advise,and it worked.

 

But when I search our store name "dannovo" by Google,the result is "osCommerce",why and what is the problem?

 

Pls kindly advise,thanks.

If the title has been changed, look at the top of the web browser while viewing your shop to check that, then it is just because google has not updated your listing. Changes you make to your shop do not instantly changed in the search engine listings. If your site is new and not checked much, it could be a month or two before such a change is made. There's nothing you can to in that case except wait. They will eventually change it.

 

As mentioned in the original post though, using the site name for the main keyword is usually a bad idea so you may want to re-think that.

Share this post


Link to post
Share on other sites

×