| Author | Message |
| Post Title: Dynamic Titles SEO just add one line! | |
THoTH
Joined: May 15, 2008 Posts: 13
|
Posted: Thu Jul 31, 2008 5:54 am
What an episode, I've been looking for how to change the title bar in the browser for better SEO with Nukedgallery. I have worked out how to do it, but the credit should rest with dmolavi for the header extraction code, but he forgot to do anything with the $pagetitle variable !
Open your index.php and find this Code: ›
foreach($javascript as $script) { $scriptline = $script; $scriptline = str_replace('"','\"',$scriptline); $header .= 'echo "' . $scriptline. '\n";'."\n"; } Then add afterwards this line Code: › $header .='echo "<title>$pagetitle - $sitename Gallery</title>";';
Done ! |
| Author | Message |
| Post Title: Re: Dynamic Titles SEO just add one line! | |
THoTH
Joined: May 15, 2008 Posts: 13
|
Posted: Thu Jul 31, 2008 6:08 am
Just as a follow up to that last post, if you want the full breadcrumb trail in the title bar, create a folder in your themes templates directory called local, then copy theme.tpl into it. Then modify that theme.tpl for your chosen theme. Find the section with the <title> definition, usually looks like this..
Code: › {* If Gallery doesn't provide a header, we use the album/photo title (or filename) *}
<title>{$theme.item.title|default:$theme.item.pathComponent|markup:strip}</title> And replace it with this Code: › <title>{if isset($separator)} {$separator} {/if}
{foreach name=parent from=$theme.parents item=parent} {if !$smarty.foreach.parent.last} » {$parent.title|markup:strip|default:$parent.pathComponent} {else} » {$parent.title|markup:strip|default:$parent.pathComponent} {/if} {if isset($separator)} {$separator} {/if} {/foreach} {if ($theme.pageType == 'admin' || $theme.pageType == 'module')} {else} » {$theme.item.title|markup:strip|default:$theme.item.pathComponent} {/if}</title> Now you have a full path in your title bar |
| Author | Message |
| Post Title: Re: Dynamic Titles SEO just add one line! | |
dari
Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Thu Jul 31, 2008 6:29 am
actually, don't modify theme.tpl. make a folder in your theme's directory called local, ie: matrix/local/ and then copy theme.tpl into there and modify that copy. this way, even if you update your g2 installation, your modification won't be lost, since g2 will always use files in the local directory first...
|
| Author | Message |
| Post Title: Re: Dynamic Titles SEO just add one line! | |
THoTH
Joined: May 15, 2008 Posts: 13
|
Posted: Thu Jul 31, 2008 8:48 am
Info amended, that'll teach me to post just before I go out.
|
| Author | Message |
| Post Title: Re: Dynamic Titles SEO just add one line! | |
dari
Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Thu Jul 31, 2008 2:19 pm
it's all good, thanks for the tip. i'm going to sticky this post
|
| Author | Message |
| Post Title: Re: Dynamic Titles SEO just add one line! | |
Stratego
Joined: Jul 22, 2007 Posts: 1
|
Posted: Sun Oct 12, 2008 1:25 am
Is it possible to do the exact same thing (title breadcrumb) but omit the root album on every album except the root one ?
My root album's name is Home, but I don't want to have "Home - Album1 - Sub-Album1" on every page, I just want "Sitename - Album1 - Sub-Album1" Thanks. |
| Author | Message |
| Post Title: Re: Dynamic Titles SEO just add one line! | |
chumstar
Joined: Sep 04, 2009 Posts: 3 Location: Australia, Sdyney
|
Posted: Mon Feb 08, 2010 8:40 am
nice and simple, will try it out
|
| Author | Message |
| Post Title: Re: Dynamic Titles SEO just add one line! | |
Suella
Joined: Dec 18, 2010 Posts: 2 Location: Los Angeles
|
Posted: Fri Jan 14, 2011 4:02 pm
I tried it out already and it worked. Thanks.
|
| Author | Message |
| Post Title: Re: Dynamic Titles SEO just add one line! | |
DestinJoe21
Joined: May 05, 2011 Posts: 2
|
Posted: Thu May 05, 2011 1:22 pm
destin beach front rentals [fivestargulfrentals.com]
destin gulf front rentals [fivestargulfrentals.com] |
| Author | Message |
| Post Title: Re: Dynamic Titles SEO just add one line! | |
DestinJoe21
Joined: May 05, 2011 Posts: 2
|
Posted: Thu May 05, 2011 1:23 pm
destin beach front rentals [fivestargulfrentals.com]
destin gulf front rentals [fivestargulfrentals.com] |