Page 3 of 4

Re: Site name in Title

Posted: Tue Oct 18, 2011 9:59 pm
by los20
Thank you so much for the code
I too like it simple and clear, I was a litle frustrated by the fact that my page titles where the cat or product names, and since I cant have massive names for these I was really sratching around
...but now im so happy !!!
Thanks again
:)

Re: Site name in Title

Posted: Thu Jan 05, 2012 1:16 am
by xlam
JAY6390 wrote:Open

Code: Select all

/catalog/controller/product/product.php
find

Code: Select all

$this->document->title = $product_info['name']; 
change to

Code: Select all

$this->document->title = $product_info['name'] . ' - ' . $product_info['manufacturer']; 
(assuming you have made Q's change in the second post)
works great for me using 1.1.5.3 :) :)

Re: Site name in Title

Posted: Thu Jan 26, 2012 11:09 am
by mogwaycz
For OC 1.5.1.3:

in catalog/controller/product/product.php find:

Code: Select all

$this->document->setTitle($product_info['name']);
and replace:

Code: Select all

if (isset($product_info['manufacturer'])) {
          $this->document->setTitle('YOURDOMAIN.XYZ - '. $product_info['name'] . ' od ' . $product_info['manufacturer']);
			}
			else
			{
          $this->document->setTitle('YOURDOMAIN.XYZ - '. $product_info['name']);
      }
in catalog/controller/product/category.php find:

Code: Select all

$this->document->setTitle($category_info['name']);
and replace:

Code: Select all

$this->document->setTitle('YOURDOMAIN.XYZ - ' . $category_info['name']);
That's all...

;)

Re: Site name in Title

Posted: Thu Jan 26, 2012 11:31 am
by Lisaweb
Thanks, this really helps me! But I couldn't find the code in the category.php you mention - did you perhaps mean catalog\controller\product\category.php?

Re: Site name in Title

Posted: Thu Jan 26, 2012 11:38 am
by Lisaweb
@mogwaycz: Weird too, I did the changes you posted, but no change in the page title. I even deleted the cache. Odd. Anyone have ideas?

Re: Site name in Title

Posted: Thu Jan 26, 2012 3:47 pm
by mogwaycz
Ailu wrote:Thanks, this really helps me! But I couldn't find the code in the category.php you mention - did you perhaps mean catalog\controller\product\category.php?
Ups, my bad... You're absolutely right. It shoud be a catalog/controller/product/category.php(previous post fixed)
Ailu wrote:@mogwaycz: Weird too, I did the changes you posted, but no change in the page title. I even deleted the cache. Odd. Anyone have ideas?
This modification is only for OC v1.5.1.3. All other modifications in previous posts didn't work for me.

Re: Site name in Title

Posted: Thu Jan 26, 2012 10:07 pm
by Lisaweb
I found out why the changes didn't show - I needed to delete my vqmod cache as well. All good now.

Thanks for you very useful post! :-)

Re: Site name in Title

Posted: Fri Jan 27, 2012 1:37 am
by mogwaycz
:good: no worries mate!

Re: Site name in Title

Posted: Fri Jan 27, 2012 5:45 pm
by qahar
I have another version, incase someone interesting.

Open header.tpl and change the title tag with code bellow:

Code: Select all

<title><?php echo $title; ?><?php if(!isset($this->request->get['route']) || $this->request->get['route'] == 'common/home') { echo " - " . $this->config->get('config_title'); } ?></title>
With code above you will get Site Title on Homepage; but get Page Title - Site Title on all pages, not just product page.

Re: Site name in Title

Posted: Mon Feb 13, 2012 4:10 am
by david007
You guys rock Thanks helped me a lot!

Re: Site name in Title

Posted: Tue Feb 21, 2012 12:54 am
by JackDavis
I've written a blog post on creating SEO friendly page titles for category and product pages which you guys might find useful? The link is:

http://www.jackwdavis.com/2012/02/17/cr ... ory-pages/

It will show you how to do what your asking for!

Cheers,

Jack

Re: Site name in Title

Posted: Tue Feb 21, 2012 10:16 pm
by Lisaweb
Thanks Jack! :-)
JackDavis wrote:I've written a blog post on creating SEO friendly page titles for category and product pages which you guys might find useful? The link is:

http://www.jackwdavis.com/2012/02/17/cr ... ory-pages/

It will show you how to do what your asking for!

Cheers,

Jack

Re: Site name in Title

Posted: Thu Feb 23, 2012 7:18 am
by prosport-rs
How to change this parameter

Code: Select all

$title
on instalation of site i type wrong site name so now i cnt find how to chante title pls any help

Re: Site name in Title

Posted: Mon Mar 12, 2012 10:54 am
by josee225
Hi,

I think I need a little help here too :)

In catalog/language/english/product/product.php, and in my second language (french), I added this line:

Code: Select all

$_['seo-title']		= 'CCG, Minis, Games, Supplies | Carta Magica Store'
I then proceeded to catalog/controller/product/product.php and changed this line

Code: Select all

$this->document->setTitle($product_info['name']);
to this line

Code: Select all

$this->document->setTitle($product_info['name'].' | '. $seo-title);
And nothing happened... Now I definitely am not a PHP programmer, so I think I have something wrong in my syntax... If someone could correct me on this, I would be very grateful!

Re: Site name in Title

Posted: Mon Mar 12, 2012 11:12 am
by qahar
josee225 wrote: In catalog/language/english/product/product.php, and in my second language (french), I added this line:

Code: Select all

$_['seo-title']		= 'CCG, Minis, Games, Supplies | Carta Magica Store'

Code: Select all

$this->document->setTitle($product_info['name'].' | '. $seo-title);
Try this:

Code: Select all

$this->document->setTitle($product_info['name'] . ' | ' . $this->language->get('seo-title'));

Re: Site name in Title

Posted: Mon Mar 12, 2012 3:21 pm
by inspirio
Thank you. Work great on 1.5.1.3. :)

Re: Site name in Title

Posted: Mon Mar 12, 2012 6:40 pm
by josee225
qahar wrote:
josee225 wrote: In catalog/language/english/product/product.php, and in my second language (french), I added this line:

Code: Select all

$_['seo-title']		= 'CCG, Minis, Games, Supplies | Carta Magica Store'

Code: Select all

$this->document->setTitle($product_info['name'].' | '. $seo-title);
Try this:

Code: Select all

$this->document->setTitle($product_info['name'] . ' | ' . $this->language->get('seo-title'));
I must be really dense.... I did what you said, changed the controller, even noticed I was missing the ; at the end of my new line in language file, fixed it, cleared my vqmod cache, and still nothing changes...

So since I would like this same seo-title all over, I added the $seo-title in my header language files, and then went into my header controller, added:

Code: Select all

$this->language->get('seo-title');
just under

Code: Select all

$this->data['title'] = $this->document->getTitle();
Then I went into my header.tpl and changed

Code: Select all

<title><?php echo $title; ?></title>
to

Code: Select all

<title><?php echo $title; ?> | <?php echo $seo-title></title>
And still nothing... I don't even have an error about this in my log, nothing! :(

Re: Site name in Title

Posted: Sun Jul 15, 2012 6:18 am
by jadeye
Hey guys...

I am trying different versions of the breadcrumbs but I keep on getting the route URL instead...
Mind you I am using n RTL version of OC 1.5.0
Maybe someone has ran into this issue....??? :)
Thank you...

Re: Site name in Title

Posted: Thu Aug 02, 2012 3:10 am
by logicPwn
I am trying to do this but I have also done the mod to make all URLs SEO friendly. I no longer have the router GET var available to check. Does OC set/save the page parsed somewhere? Otherwise I will need to do this myself. You think OC would save the route instead of checking the GET var every time.

Re: Site name in Title

Posted: Tue Jan 01, 2013 8:34 am
by witalous
Thank you guys!

Served me so much!

Hug!