Post by JAY6390 » Fri Oct 22, 2010 2:11 am

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

ImageImageImage

SEO MEGA KIT PLUS - Get your site ranking higher in the search engines
Better Product SEO URL's - Perfectly structured product links
SEO URL's Route Editor PRO - Make ANY url on your site have clean keywords - even third party extensions (remove index.php)


Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by barnesnet » Fri Oct 22, 2010 2:24 am

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.

New member

Posts

Joined
Sat Oct 02, 2010 6:18 am


Post by JAY6390 » Fri Oct 22, 2010 2:26 am

If it's just one or two pages, you can mangle them together but its not really recommended tbh

ImageImageImage

SEO MEGA KIT PLUS - Get your site ranking higher in the search engines
Better Product SEO URL's - Perfectly structured product links
SEO URL's Route Editor PRO - Make ANY url on your site have clean keywords - even third party extensions (remove index.php)


Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by i2Paq » Fri Dec 03, 2010 12:45 am

What if I want:

Product name - Manufacturer name - Store name

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

UPGRADE to 2.x: Contemplate before thou begins!

Our FREE search: Find your answer FAST!.

BUGs?: Known BUGS for All OC Versions.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by JAY6390 » Fri Dec 03, 2010 12:56 am

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)

ImageImageImage

SEO MEGA KIT PLUS - Get your site ranking higher in the search engines
Better Product SEO URL's - Perfectly structured product links
SEO URL's Route Editor PRO - Make ANY url on your site have clean keywords - even third party extensions (remove index.php)


Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by i2Paq » Fri Dec 03, 2010 1:13 am

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

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

UPGRADE to 2.x: Contemplate before thou begins!

Our FREE search: Find your answer FAST!.

BUGs?: Known BUGS for All OC Versions.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by itsyellow » Mon Dec 06, 2010 4:09 am

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!

Be creative! Be passion!


User avatar
Newbie

Posts

Joined
Sun Nov 28, 2010 8:12 am
Location - San Diego

Post by i2Paq » Sat Dec 11, 2010 7:43 pm

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?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

UPGRADE to 2.x: Contemplate before thou begins!

Our FREE search: Find your answer FAST!.

BUGs?: Known BUGS for All OC Versions.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by i2Paq » Fri Dec 17, 2010 4:14 am

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

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

UPGRADE to 2.x: Contemplate before thou begins!

Our FREE search: Find your answer FAST!.

BUGs?: Known BUGS for All OC Versions.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Chones » Fri Dec 17, 2010 5:20 am

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.

http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk


User avatar
Active Member

Posts

Joined
Wed Mar 24, 2010 9:07 pm
Location - London

Post by i2Paq » Fri Dec 17, 2010 6:21 am

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

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

UPGRADE to 2.x: Contemplate before thou begins!

Our FREE search: Find your answer FAST!.

BUGs?: Known BUGS for All OC Versions.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Chones » Fri Dec 17, 2010 6:32 am

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.

http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk


User avatar
Active Member

Posts

Joined
Wed Mar 24, 2010 9:07 pm
Location - London

Post by jcgadgets » Thu Jan 13, 2011 8:23 pm

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

Active Member

Posts

Joined
Sun Oct 31, 2010 4:49 pm

Post by Qphoria » Thu Jan 13, 2011 8:47 pm

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

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by andris » Mon Jan 17, 2011 7:13 pm

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

New member

Posts

Joined
Fri Nov 19, 2010 4:34 am

Post by Emanuele » Sat Mar 19, 2011 7:40 pm

how can I'll add the category name in the title?

Newbie

Posts

Joined
Tue Mar 15, 2011 7:15 pm

Post by Emanuele » Sat Mar 19, 2011 7:48 pm

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'];

Newbie

Posts

Joined
Tue Mar 15, 2011 7:15 pm

Post by promofire » Tue Jun 14, 2011 10:35 pm

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

Active Member

Posts

Joined
Thu Jan 27, 2011 2:00 am

Post by 1127DEV » Tue Sep 06, 2011 11:38 pm

How would I display "Shop Name | Category | Product" in 1.5.1.1

Newbie

Posts

Joined
Fri Aug 19, 2011 12:06 pm

Post by theloneus » Tue Oct 04, 2011 4:30 am

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.

Newbie

Posts

Joined
Tue Oct 04, 2011 4:29 am
Who is online

Users browsing this forum: No registered users and 9 guests