Changing the title of blogger posts

Sunday, May 11, 2008

Today I was learning some search engine optimization techniques which will be useful for improving the page rank of a site, where I came to know the importance of having relevant title for the page contents.

Since in Blogger the blog's title and individual post's title are appended when displaying a specific entry, I thought it's an area which can be customized by having only the title corresponding to the blog item being displayed, as with any lazy user looking for a quick fix, I was googling for the solution, though I found a very useful one, unfortunately it didn't work (but got a chance to see how bloggers were looking for that solution so badly :)).

After some hours of futile effort when I was about to defer the solution to the next day, I logged into blogger for posting some entry when I saw an useful tip at the home page.

"Layouts now has a blog.pageName datum that gives the name of the current page without the “[Blog Name]: ” prefix that blog.pageTitle adds."

The solution then was very simple, all you need to do is replace the below line in the Layout template.

<title><data:blog.pageTitle/></title>

TO

<b:if cond='data:blog.pageType == "item"'>
<title><data:blog.pageName/></title>
<b:else/>
<title><data:blog.pageTitle/></title>
</b:if>

Problem solved :)

The lesson learned: Always look for simple, yet powerful tips whenever you invoke a Software or from home page information after login rather than skipping those at the first sight. Most tools when invoked will display a 'Tip of the day' which is ignored by most of the users, had I applied it to Blogger, some 3 - 4 hours would have been saved.


6 comments:

WRS Staff said...

Thanks very much for the help!

inoow said...

yeah this is sandeep thanks for this simple code i was going haywire with that old code circulating everywhere, i will try to now sow up your new code for the rest....

Prasanna Seshadri said...

Nice to know that you landed up here for a good solution.

Anonymous said...

Great, thanks.

hitech83 said...

thx very mutch man;-)

www.hjaya.blogspot.com
www.noukta-taourirt.blogspot.com
www.jocks-ma.blogspot.com

i'd bookmarkt your blog :-)

Prasanna Seshadri said...

You are welcome, I saw your blogs too, though the languages were little different, but I could still read the blogs on jokes :), good.


Copyright © 2016 Prasanna Seshadri, www.prasannatech.net, All Rights Reserved.
No part of the content or this site may be reproduced without prior written permission of the author.