Post by azmansell » Sun Sep 13, 2009 1:02 am

hi there,
im struggling to get my site name to show up in products etc. for example on my other site DingDongDisco (http://www.dingdongdisco.com) , if you go to a post the title in the bar at the top says Post Name | DingDongDisco (http://www.dingdongdisco.com/2009/09/kr ... osyncrasy/)

Yet on my opencart run shop, if you go to a particular product, it literally just shows the bproduct name. for example (http://www.clubberclobber.co.uk/index.p ... uct_id=158) show only Army Cheerleader outfit.

Is there anyway for it to show Army Cheerleader outfit | UK Clubwear by Clubber Clobber?

my site is indexed on google and it only shows the product name which could be problematic for SEO

cheers in advance
aaran
Clubber Clobber
http://www.clubberclobber.co.uk
O0

Newbie

Posts

Joined
Mon Aug 31, 2009 7:07 pm

Post by Qphoria » Sun Sep 13, 2009 1:42 am

(v1.3.2 and older)
1a. Edit catalog/view/theme/default/template/common/layout.tpl

OR

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

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by azmansell » Sun Sep 13, 2009 2:08 am

FANTASTIC!
you a star, and a fast response.
cheers!

;D

Newbie

Posts

Joined
Mon Aug 31, 2009 7:07 pm

Post by amplifywebdesign » Tue Sep 15, 2009 1:24 am

Great I was just about to ask how to do this :D

User avatar
New member

Posts

Joined
Sat Aug 22, 2009 1:56 am
Location - Sheffield & North Wales

Post by kcllc » Thu Oct 22, 2009 5:27 pm

And if one wanted to add the category?

Example: Product Name | Category Name | Site Name Here

New member

Posts

Joined
Mon Sep 07, 2009 9:48 pm

Post by d33p » Fri Oct 23, 2009 11:44 pm

kcllc wrote:And if one wanted to add the category?

Example: Product Name | Category Name | Site Name Here
I'd also like to do that, in terms of SEO that would be very useful.

Newbie

Posts

Joined
Tue May 26, 2009 12:11 am

Post by katalin » Fri May 14, 2010 7:35 am

How can we make titles like: Subcategory | Category ?

Active Member

Posts

Joined
Wed May 05, 2010 2:28 am

Post by paola84 » Fri Jun 04, 2010 11:06 pm

How can I make this modification in v1.4.7 ?
And is there any way to put also the category name in the title?

Newbie

Posts

Joined
Fri Jun 04, 2010 11:01 pm

Post by matteo84 » Mon Jun 07, 2010 10:10 pm

paola84 wrote:How can I make this modification in v1.4.7 ?
Hi Paola!
I'm new to OpenCart... so i don't know if this is the best way to solve the problem.

In /catalog/controller/view/theme/default/template/common/header.tpl approximately at line #5 you'll find

Code: Select all

<title><?php echo $title; ?></title>
Replace this line with this code...

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>
This should solve your problem. ;)

Regards.
Matteo

Newbie

Posts

Joined
Mon Jun 07, 2010 9:58 pm

Post by paola84 » Mon Jun 07, 2010 10:16 pm

Thank you Matteo, you're my saviour!!! :D

Newbie

Posts

Joined
Fri Jun 04, 2010 11:01 pm

Post by katalin » Wed Jun 09, 2010 5:11 am

How can we use your mod for categories only? I don't want this mod to apply to products.

Active Member

Posts

Joined
Wed May 05, 2010 2:28 am

Post by dada » Thu Jul 08, 2010 11:38 pm

Qphoria wrote:(v1.3.2 and older)
1a. Edit catalog/view/theme/default/template/common/layout.tpl

OR

(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 } ?>
It looks like it doesn't work with 1.4.8. How do i get store name in 1.4.8?

Newbie

Posts

Joined
Fri Jul 02, 2010 1:08 am

Post by Qphoria » Fri Jul 09, 2010 1:40 am

try config_name instead of config_store

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Chrissy Poo » Wed Jul 14, 2010 9:04 am

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?

10% Discount on all Shared and Reseller Hosting Packages at Vidahost.com

Discount Code: DISCOUNT10


Active Member

Posts

Joined
Mon Jun 29, 2009 8:48 am
Location - UK

Post by OSWorX » Thu Jul 29, 2010 1:25 am

Generally it is a bad idea NOT to work inside the controller.

Anyway, do NOT use the array_reverse.
Instead after the final }:

Code: Select all

}
echo $this->config->get('config_title') .' - '. implode(' - ', $titleBreadCrumbs);

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by barblask » Thu Sep 16, 2010 5:46 pm

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

Code: Select all

<?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_values($titleBreadCrumbs);
   
    echo implode(' - ', $titleBreadCrumbs) . ' - ';
}
echo $this->config->get('config_title');
# END - titleBreadCrumbs
?>
</title>
Use this code

User avatar
Newbie

Posts

Joined
Thu Sep 16, 2010 5:42 pm


Post by Melanie » Mon Oct 11, 2010 11:49 am

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

New member

Posts

Joined
Tue Mar 30, 2010 9:39 am

Post by Melanie » Mon Oct 11, 2010 11:53 am

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'

New member

Posts

Joined
Tue Mar 30, 2010 9:39 am

Post by barnesnet » Tue Oct 19, 2010 6:06 pm

Running OC 1.4.9.1
Require some help with simple coding please.

I have currently replaced /catalog/view/theme/my theme/template/common/header.tpl

Code: Select all

<title><?php echo $title; ?></title>
with:

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(' &bull; ', $titleBreadCrumbs) . ' - ';
}
echo $this->config->get('config_name');
# END - titleBreadCrumbs
?>
</title>
This gives me everything I am looking for in the format of:
Product - Sub cat - category - store NAME
This works fine on all category and product pages etc.

However on my ‘Homepage’ it obviously only shows ‘store NAME’ (using config_name)

How can I alter this code so that everything remains as is but on the ‘Home page’ the code shows just the “config_TITLE’
To sum up:
Homepage title to show config_title
Other pages title to show code as above with config_name

It must be something to do with an ‘if’ line but I do not know PHP to work it out myself. I have played with it but now ned someone who knows to help out please.

Any help appreciated.

Simon

New member

Posts

Joined
Sat Oct 02, 2010 6:18 am


Post by dantheman50_98 » Fri Oct 22, 2010 2:04 am

I'd also like to have a custom homepage title that doesn't show on all pages of the site. Is this possible?

Active Member

Posts

Joined
Sat Sep 18, 2010 2:18 am
Who is online

Users browsing this forum: No registered users and 37 guests