Support Forums | Demo Gallery [1.x] [2.x] | Downloads | News | Site Map ]
Nuked Gallery
  Create a FREE account or Login   As a guest, you don't have access to our FULL navigation system.
 Forum FAQForum FAQ   StatisticsStatistics   SearchSearch   UsergroupsUsergroups   FavoritesFavorites  

Dynamic Titles SEO just add one line!

 
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Gallery 2 Integration View previous topicPrinter friendly versionView next topic
Author Message
THoTH

Beginner
Beginner


Joined: May 15, 2008
Posts: 13

PostPosted: Thu Jul 31, 2008 5:54 am    Post subject: Dynamic Titles SEO just add one line! Reply with quote

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 ! Wink

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 !
Back to top
Offline View user's profile Send private message Visit poster's website
AdBot
   Post subject: Dynamic Titles SEO just add one line!  

Back to top
THoTH

Beginner
Beginner


Joined: May 15, 2008
Posts: 13

PostPosted: Thu Jul 31, 2008 6:08 am    Post subject: Re: Dynamic Titles SEO just add one line! Reply with quote

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}
     &raquo; {$parent.title|markup:strip|default:$parent.pathComponent}
  {else}
     &raquo; {$parent.title|markup:strip|default:$parent.pathComponent}
  {/if}
  {if isset($separator)} {$separator} {/if}
  {/foreach}
  {if ($theme.pageType == 'admin' || $theme.pageType == 'module')}
  {else}
      &raquo; {$theme.item.title|markup:strip|default:$theme.item.pathComponent}
  {/if}</title>


Now you have a full path in your title bar Cool


Last edited by THoTH on Thu Jul 31, 2008 8:52 am; edited 1 time in total
Back to top
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6318
Location: Washington Township, NJ, USA

PostPosted: Thu Jul 31, 2008 6:29 am    Post subject: Re: Dynamic Titles SEO just add one line! Reply with quote

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...
Back to top
Offline View user's profile Send private message Visit poster's website
THoTH

Beginner
Beginner


Joined: May 15, 2008
Posts: 13

PostPosted: Thu Jul 31, 2008 8:48 am    Post subject: Re: Dynamic Titles SEO just add one line! Reply with quote

Info amended, that'll teach me to post just before I go out. Laughing
Back to top
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6318
Location: Washington Township, NJ, USA

PostPosted: Thu Jul 31, 2008 2:19 pm    Post subject: Re: Dynamic Titles SEO just add one line! Reply with quote

it's all good, thanks for the tip. i'm going to sticky this post Smile
Back to top
Offline View user's profile Send private message Visit poster's website
Stratego

Beginner
Beginner


Joined: Jul 22, 2007
Posts: 1

PostPosted: Sun Oct 12, 2008 1:25 am    Post subject: Re: Dynamic Titles SEO just add one line! Reply with quote

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.
Back to top
Offline View user's profile Send private message
chumstar

Beginner
Beginner


Joined: Sep 04, 2009
Posts: 4
Location: Australia, Sdyney

PostPosted: Mon Feb 08, 2010 8:40 am    Post subject: Re: Dynamic Titles SEO just add one line! Reply with quote

nice and simple, will try it out
Back to top
Offline View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Gallery 2 Integration View previous topicPrinter friendly versionView next topic

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours

Powered by phpBB © phpBB Group



Sponsors: Dedicated ServersDomain NamesWeb HostingDomain Name RegistrationDedicated Web HostingWeb Design New YorkCompare VoIPSEO IndiaWeb Design MelbournePhoenix SEOPhoenix Web MarketingSEOflorida web design companyScottsdale Interior Designweb marketing servicesScottsdale SEOAsked Last NightSEO ServicesSEO IndiaWeb Development IndiaPHP Web Development IndiaWeb DirectoryNew York Yellow Pages

7th year online! 2003-2010
Legal • Use of this site consitutes agreement to the Acceptable Use Policy
Hosted by Implosion WorksSourceForge.net Logo • Theme by TonicMedia