Jump to content

Removing shop name form title tag


Recommended Posts

Has any new tool / setting been created to turn off this?

We all know SEs don't like too many characters in the title tags, so I'm surprised there's still no easy way ( for non-coders ) to turn it off.

 

I only found 2 posts taling about this. One was too old form my 1.4.6.2 version. The other one is talking about using an attached file, which i can't see in the post.

 

Any suggestions? My shop name is pretty long and taking a lot of space.

 

Thanks.

Link to comment
Share on other sites

You have to have the "shop name" in the contact info. It's gets used in different places.

 

Right now presta add the Shop Name at the end of the title tag, even if you don't have it in that field. I have my one title in that box but not my shop name, yet, it shows up online.

 

To clear things up, I do NOT want the shop name in the title tag.

Link to comment
Share on other sites

Yes the shop name is there, under preferences. It has to be there because it's used in other places, so I can't delete it.

Under prefereces > SEO I typed my own title and the shop name is not it it. Yet it shows us online.

 

My question is the opposite. I do NOT want the shop name in the title.

 

Thanks.

Edited by berta recchia (see edit history)
Link to comment
Share on other sites

I found this old post where it says to change

 

$ret['meta_title'] = (isset($metas['title']) AND $metas['title']) ? Configuration::get('PS_SHOP_NAME').'-'.$metas['title'] : Configuration::get('PS_SHOP_NAME');

To

$ret['meta_title'] = (isset($metas['title']) AND $metas['title']) ? $metas['title'] : '';

 

But this post is from 2009.

 

The new code looks quite different.

Can anyone adjust it for version 1.4?

Link to comment
Share on other sites

  • 1 year later...

If you know php well you can override function "public function displayHeader()" in classes/FrontController.php

 

changing before:

self::$smarty->assign(array(
			'HOOK_HEADER' => Module::hookExec('header'),
			'HOOK_TOP' => Module::hookExec('top'),
			'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn')
                        'MY_CUSTOM_HEADER' => 'THis is custom header'
		));
//and in header.tpl file out put like this...
//before
<title>{$meta_title|escape:'htmlall':'UTF-8'}</title>

{if isset($MY_CUSTOM_HEADER)}<title>{$MY_CUSTOM_HEADER|escape:'htmlall':'UTF-8'}</title>
{/if}

Or edit header.tpl like you need.

 

You need know a litle of smarty and html

 

You can edit this by using if else statments 

 

like if page is not like you need so change title as you need

 

Like this

!!!!!This is not working code to copy past!!!!!


<title>My default title</title>
{if $page = cart.php}
<title>Card</title>
{elseif $page = products.php}
<title>Products</title>
{/if}


!!!!!This is not working code to copy past!!!!!
Edited by anseme (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...