Go Back   Pligg CMS Forum > Pligg Help > General Help

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: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hadock
Cool Change page title only for story page - Google

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
Coder
 
Join Date: Dec 2005
Posts: 1,574
Thanks: 235
Thanked 345 Times in 206 Posts
edit: what I posted obviously isn't going to work.... dunno what I was thinking :)
__________________
- Ash

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: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hadock
Wink

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: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hadock
Cool

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: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hadock
Red face

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: 73
Thanks: 2
Thanked 2 Times in 1 Post
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
Thanks: 2
Thanked 0 Times in 0 Posts
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: 73
Thanks: 2
Thanked 2 Times in 1 Post
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.8.2
Pligg Template: custom yget
 
Join Date: Jun 2007
Location: Colorado
Posts: 56
Thanks: 10
Thanked 0 Times in 0 Posts
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: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up GReat THX !

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
__________________
Big Bigger P L I G G
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Alexa & Google Rank #5 3dKiller My Pligg Site 36 10-27-2008 06:21 AM
SEO (Search Engine Optimization) Yankidank Wiki Articles 23 12-02-2007 12:27 PM
Page Title - Instant Need plum Suggestions 5 10-17-2007 01:57 PM
Change Title and description in RSS page hadock General Help 2 05-14-2007 11:57 AM


Search Engine Friendly URLs by vBSEO 3.2.0