Page 2 of 4

Re: Site name in Title

Posted: Fri Oct 22, 2010 2:11 am
by JAY6390
It is, but you will need to make some core edits, adding a new field to the tables of the pages you want them on (like product, category etc) and then adding them all into the controller, models, views of the admin area, and also the controller for the catalog in the front end. Once you've done that, you can assign the title if one exists instead of the product/category etc title

Re: Site name in Title

Posted: Fri Oct 22, 2010 2:24 am
by barnesnet
I think it just needs someone fluent in PHP to code an ‘if’
Roughly translated:
If this page is the homepage show config_title else show the rest of this script (containg seo details and config_name).

Similar to this I suppose:

Code: Select all

<?php if (isset($this->request->get['route']) && $this->request->get['route'] != 'common/home') { ?>
<title><?php echo $title; ?> | <?php echo $this->config->get('config_store'); ?></title>
<?php } else { ?>
<title><?php echo $title; ?></title>
<?php } ?>
I tried munging the two together but obviously no luck.


Can PHP’rs got a clue??

Any help appreciated.

Re: Site name in Title

Posted: Fri Oct 22, 2010 2:26 am
by JAY6390
If it's just one or two pages, you can mangle them together but its not really recommended tbh

Re: Site name in Title

Posted: Fri Dec 03, 2010 12:45 am
by i2Paq
What if I want:

Product name - Manufacturer name - Store name

Re: Site name in Title

Posted: Fri Dec 03, 2010 12:56 am
by JAY6390
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)

Re: Site name in Title

Posted: Fri Dec 03, 2010 1:13 am
by i2Paq
Yep, I did.

You code works but I adjusted it a bit:

Code: Select all

$this->document->title = $product_info['name'] . $this->language->get('text_by') . $product_info['manufacturer']; 
Add to catalog\language\YOUR-LANGUAGE\product\product.php

Code: Select all

$_['text_by']             = ' by ';
So now the title will look:
MacBook by Apple | Your Store
Now we need to get the <H1> and </H1> in the title...

Re: Site name in Title

Posted: Mon Dec 06, 2010 4:09 am
by itsyellow
Melanie wrote:
Melanie wrote:
Chrissy Poo wrote:OK this is thread has really helped me out which is cool :)

I replaced my title tag with this code from above:

Code: Select all

<title>
<?php
# BEGIN - titleBreadCrumbs
if(!empty($this->document->breadcrumbs)) {
    $titleBreadCrumbs = array();
   
    foreach($this->document->breadcrumbs as $breadcrumb) {
        if($breadcrumb['text'] != $this->language->get('text_home'))
        $titleBreadCrumbs[] = $breadcrumb['text'];
    }
   
    $titleBreadCrumbs = array_reverse($titleBreadCrumbs);
   
    echo implode(' - ', $titleBreadCrumbs) . ' - ';
}
echo $this->config->get('config_title');
# END - titleBreadCrumbs
?>
</title>
and it produces the following page titles:

Sub Category - Category - Store Name

is there a way to reverse this so it says:

Store Name - Category - Sub Category

Any ideas?

How can I make it show Sub Category - Category - Store Name

But for the store name just the company name i.e. MY COMPANY

instead of MY COMPANY - I SPECIALIZE IN XYZ



Thanks,
Melanie

Done.

Changed 'config_title' to 'config_name'
By Y~: This works for me~ thanks!

Re: Site name in Title

Posted: Sat Dec 11, 2010 7:43 pm
by i2Paq
Qphoria wrote: (v1.3.4 and later)
1b. Edit catalog/view/theme/default/template/common/header.tpl

2. FIND:

Code: Select all

<title><?php echo $title; ?></title>
3. REPLACE WITH:

Code: Select all

<?php if (isset($this->request->get['route']) && $this->request->get['route'] != 'common/home') { ?>
<title><?php echo $title; ?> | <?php echo $this->config->get('config_store'); ?></title>
<?php } else { ?>
<title><?php echo $title; ?></title>
<?php } ?>
I want to get the <H1> and </H1> added to the title so the when when I look at my page source I see <H1>My Title</H1>, how do I go about getting this in?

Re: Site name in Title

Posted: Fri Dec 17, 2010 4:14 am
by i2Paq
i2Paq wrote:
Qphoria wrote: (v1.3.4 and later)
1b. Edit catalog/view/theme/default/template/common/header.tpl

2. FIND:

Code: Select all

<title><?php echo $title; ?></title>
3. REPLACE WITH:

Code: Select all

<?php if (isset($this->request->get['route']) && $this->request->get['route'] != 'common/home') { ?>
<title><?php echo $title; ?> | <?php echo $this->config->get('config_store'); ?></title>
<?php } else { ?>
<title><?php echo $title; ?></title>
<?php } ?>
I want to get the <H1> and </H1> added to the title so the when when I look at my page source I see <H1>My Title</H1>, how do I go about getting this in?
Gentle BUMP :P

Re: Site name in Title

Posted: Fri Dec 17, 2010 5:20 am
by Chones
Do you want something like this?

<title><h1>My Title</h1></title>

If so, don't do it as it's not the way meta tags work. <title>My Title</title> is perfect.

Re: Site name in Title

Posted: Fri Dec 17, 2010 6:21 am
by i2Paq
Chones wrote:Do you want something like this?

<title><h1>My Title</h1></title>

If so, don't do it as it's not the way meta tags work. <title>My Title</title> is perfect.
I've been told by a SEO guru once that this should be done.
After I did this to my osCommerce store my titles started to be noticed by Google....

Re: Site name in Title

Posted: Fri Dec 17, 2010 6:32 am
by Chones
Honestly, that is completely wrong. Tags should be used properly and semantically. The title tag should be used on its own:
<title>Your Title</title>
Headings should be used properly too - you should only have one <h1> heading on your page and it should contain as many keywords and phrases as you can fit in without it looking spammy.
Take it from someone who regularly tops Google results even although I only have a few links to my site.

Re: Keeping meta description for home page

Posted: Thu Jan 13, 2011 8:23 pm
by jcgadgets
I'd also be very interested in keeping the home page's title as the meta description tag while using this mode - any ideas anyone (that don't require dangerous core edits)?


Thank you,
Jared

Re: Site name in Title

Posted: Thu Jan 13, 2011 8:47 pm
by Qphoria
i2Paq wrote:
Chones wrote:Do you want something like this?

<title><h1>My Title</h1></title>

If so, don't do it as it's not the way meta tags work. <title>My Title</title> is perfect.
I've been told by a SEO guru once that this should be done.
After I did this to my osCommerce store my titles started to be noticed by Google....
I think maybe there was some wording disconnect. I'm assuming that in terms of formatting, he mentioned that your "Page Title" should be in <h1> (not <H1>) which is true, for formatting sake, h1 should be on your page only once and should be the page title. This is not the same thing as the "meta title" which is the <title> tag. Anything inside the <head> tag does not use formatting and just shows as literal text.

Maybe I'm wrong and he has some trickery that I dunno about but it is certainly just going to show <h1> as if it were plain text

Re: Site name in Title

Posted: Mon Jan 17, 2011 7:13 pm
by andris
<?php echo $this->config->get('config_store'); ?> this doesnt display anything at the title bar..

i am simply using <?php echo $store; ?> which displays store name on title bar..

is this a correct way to get your store name | page title?

Code: Select all

<?php if (isset($this->request->get['route']) && $this->request->get['route'] != 'common/home') { ?>
<title><?php echo $store; ?> | <?php echo $title; ?></title>
<?php } else { ?>
<title><?php echo $title; ?></title>
<?php } ?>

Re: Site name in Title

Posted: Sat Mar 19, 2011 7:40 pm
by Emanuele
how can I'll add the category name in the title?

Re: Site name in Title

Posted: Sat Mar 19, 2011 7:48 pm
by Emanuele
ok I changed this:

Code: Select all

$this->document->title = $product_info['name'];
with this:

Code: Select all

$this->document->title = $product_info['name'] . ' - ' . $product_info['manufacturer'] . ' : ' . $category_info['name'];

Re: Site name in Title

Posted: Tue Jun 14, 2011 10:35 pm
by promofire
How do I make it work so I get:

Product Name - Category - Store Name
or if it's easier, even just Product Name - Store Name

But only on product pages? I've already gotten it to include a custom subtitle on category pages using a nifty vqmod I found here and this code above replaces that which I don't want.

Thanks

Re: Site name in Title

Posted: Tue Sep 06, 2011 11:38 pm
by 1127DEV
How would I display "Shop Name | Category | Product" in 1.5.1.1

Re: Site name in Title

Posted: Tue Oct 04, 2011 4:30 am
by theloneus
Also would like to know how to do breadcrumbs in the title tag in 1.5.x.x

Sorry for the necrobump, but I've searched all over for how to do this.