Change page title only for story page - Google

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-20-2007, 08:00 AM
New Pligger
 
Join Date: Apr 2007
Location: Lille - France
Posts: 8
Send a message via MSN to hadock
Hello,

I want to know how personnalize the HTML page title for the story page title only...

Why : To have only story title on page title and optimise google ranking.
When Google parse my pages, the title keep is always " MY SITE NAME - MY STORIE TITLE"

I will prefer to have : " STORIE TITLE" only on page title

Do you know what I have to modify to keep only story title ?

Please, help me, I had search many hours and try a lot of change without the good result...


Thanks !

And sorry for my poor english...
Reply With Quote
  #2 (permalink)  
Old 05-20-2007, 09:03 AM
AshDigg's Avatar
Mayor of PliggVille/Coder
 
Join Date: Dec 2005
Posts: 1,515
edit: what I posted obviously isn't going to work.... dunno what I was thinking

Last edited by AshDigg; 05-24-2007 at 12:51 AM.
Reply With Quote
  #3 (permalink)  
Old 05-21-2007, 05:02 AM
New Pligger
 
Join Date: Apr 2007
Location: Lille - France
Posts: 8
Send a message via MSN to hadock
Many thanks for your help Ash !

I will try this solution today and reply to confirm that all is OK

Pligg power !
Reply With Quote
  #4 (permalink)  
Old 05-21-2007, 06:50 AM
New Pligger
 
Join Date: Apr 2007
Location: Lille - France
Posts: 8
Send a message via MSN to hadock
Hello Dash,

Sorry but I just try your modificiation...
And the result is not good...

After modification the page title is the Website Name and title only... The story title is not available on the title..

to resume :
for story.php on line 78 :

$main_smarty->assign('posttitle', " - ". $link->title);
---> I got Website name + story title
(normal and standard config)

$main_smarty->assign($link->title);
---> I got only the Website name on page title...

$main_smarty->assign('posttitle');
---> I got only the Website name on page title...

Strange...

Someone can help me to sovle this issue ?

Thanks
Reply With Quote
  #5 (permalink)  
Old 05-22-2007, 04:27 AM
New Pligger
 
Join Date: Apr 2007
Location: Lille - France
Posts: 8
Send a message via MSN to hadock
Sorry ... I really need this help to increase my page rank in Google.

Someones can explain me how use the story title (and only story title) as page title for story.php page ?

Thanks
Reply With Quote
  #6 (permalink)  
Old 05-26-2007, 05:13 PM
wwwSENSERELYcom's Avatar
Casual Pligger
 
Join Date: May 2007
Location: Tianjin, China
Posts: 67
In the file /templates/yget/pligg.tpl instead of this at about line 55 :

Quote:
<title>{$posttitle}</title>
you replace it with :

Quote:
{if $pagename eq "story"}
<title>{$posttitle|substr:3}</title>
{else}
<title>{$pretitle}{#PLIGG_Visual_Name#}{$posttitle }</title>
{/if}
That way, all other titles are not affected, only when you're looking at a story page. Why I use the Smarty modifier (php command) substr? Because $posttitle has " - " in front of it, so that removes it.

Imagine you want to have your title with uppercase in front of all words, then you would want to use the php function "ucwords" to add it in smarty you append it like this:
Quote:
<title>{$posttitle|substr:3|ucwords}</title>
Have some fun with php functions (such as strtoupper) but don't break everything :-)
Reply With Quote
  #7 (permalink)  
Old 10-17-2007, 08:32 AM
New Pligger
 
Join Date: Oct 2007
Posts: 22
Hello,

I'm using the latest version of Pligg and it seems that the code you wrote here is already in the pligg/tpl file, but it doesn't work for me and I don't get the story title in the page name, can you help?

Thanks.
Reply With Quote
  #8 (permalink)  
Old 10-17-2007, 08:37 AM
wwwSENSERELYcom's Avatar
Casual Pligger
 
Join Date: May 2007
Location: Tianjin, China
Posts: 67
I think only god can help you on this one.
Reply With Quote
  #9 (permalink)  
Old 12-08-2007, 12:59 PM
Casual Pligger
Pligg Version: 9.9.5
Pligg Template: custom yget
 
Join Date: Jun 2007
Location: Colorado
Posts: 65
Quote:
Originally Posted by wwwSENSERELYcom View Post
In the file /templates/yget/pligg.tpl instead of this at about line 55 :



you replace it with :



That way, all other titles are not affected, only when you're looking at a story page. Why I use the Smarty modifier (php command) substr? Because $posttitle has " - " in front of it, so that removes it.

Imagine you want to have your title with uppercase in front of all words, then you would want to use the php function "ucwords" to add it in smarty you append it like this:


Have some fun with php functions (such as strtoupper) but don't break everything :-)
Thanks for this James. Works like a charm
Reply With Quote
  #10 (permalink)  
Old 12-19-2007, 08:54 AM
pliggfreak's Avatar
Casual Pligger
 
Join Date: Apr 2007
Posts: 32
in yourtemplate/pligg.tpl 9.8.2
search for <title>
replace with this :

PHP Code:
{if $pagename eq "story"}
<
title>{$posttitle|substr:3}</title>
{else}
<
title>{$pretitle}{#PLIGG_Visual_Name#}{$posttitle }</title>
{/if} 
Works great !!!
Now i have only the title of story in my title :-D
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Title - Instant Need plum Questions and Comments 6 11-16-2009 04:35 PM
How to change the page title bhanu210 Questions and Comments 2 04-02-2008 11:22 PM
Change Title and description in RSS page hadock Questions and Comments 2 05-14-2007 11:57 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development