Displaying Widgets on Specific Pages in Blogger

by Sushant Risodkar on January 19, 2009

make money online

One of the reader recently commented on my blog to know how I show some widgets on the blog main page and it hides away on the content or item pages. The answer of this I will say that I use Conditional Tags in my Blogger Template which gives “condition” to any widget that where to appear and where not to. I am using these conditional tags at many places in my blog.

So through this post I will teach you that how you can easily make use of these Conditional Tags in your template and easily play with the positions of your widgets :)


So first let me tell you the proper definition of Conditional Tags according to blogger.

Conditional tags are Blogger template tags that allow you greater flexibility in your template design. We call them conditional because they allow you to specify parts of your template that appear only under certain conditions.

Ok; so you got the definition now let’s move on to How you can implement it.

Implementation

First make sure to make a full backup of your existing template before attempting these Conditional Tags.

So before using these tags in your template; first just add any widget in your blog by the default way.
Now when you have added it Go to Layout > Edit HTML > Click on the Expand Box

Then search for any widget by the name which you have given it as title.

Display the widget only on Homepage

If you want to make an widget appear on main page only then we will use the following code:

<b:if cond=’data:blog.pageType == &quot;index&quot;>
</b:if>

Now let me tell you how to paste it:

Place <b:if cond=’data:blog.pageType == &quot;index&quot;> tag just after the opening <b:includable id=’main’> tag and Place the closing </b:if> tag just before the closing </b:includable> tag.

Display Widget on Post Pages Only

If you want to make an widget appear on main page only then we will use the following code:

<b:if cond='data:page.type == &quot;item&quot;'>
</b:if>

Now let me tell you how to paste it:

It’s almost the same thing to do just replace <b:if cond='data:blog.pageType == &quot;index&quot;> with <b:if cond='data:page.type == &quot;item&quot;'> from the above method.

Display widget On Specific Page/URL Only

By this method you can display any special widget on any special page which is important for it.

For this we will use the following code:

Just add <b:if cond='data:blog.url == "BLOG_PAGE_URL"'> in the same way in the above mention methods just in this replace BLOG_PAGE_URL with the URL where you want the widget to appear.

Display widget On Specific Label Page Only

By this method you can display any widget on any specific label page. For example you may have posts on books and when the label books is clicked in your blog the sidebar will show a widget which you have added specially for books.

For this we will use the following code:

<b:if cond='data:blog.url == "http://BLOG_NAME.blogspot.com/search/label/LABEL_NAME"'>
</b:if>

Now let me tell you how to paste it:

Just use the above code i.e <b:if cond='data:blog.url == "http://BLOG_NAME.blogspot.com/search/label/LABEL_NAME"'> in the same as we did for Displaying widgets only on homepage.

Here, replace BLOG_NAME with your blog actual name and LABEL_NAME with the label which is currently being used in your blog and where you want it to appear.

So I think you know the use of Conditional Tags and It’s Implementation.Well if you have any problem then do ask me. You can also take my help in implementing it for free in you blog by my hands for which you just have send in your blogger info to my mail via contact form.

Image Courtsey: Bloggerbuster
Inspired by: BlogDoctor


Top 10 Search Terms:

• only display widget certain pages blogger • blogger conditional tags • conditional tags in blogger • Display Widgets Only on Certain pages • blogger conditional tag • blogger widgets on pages • conditional tags blogger • blogger widget on specific page • how to make blogger widget appear only on one page • how to show widgets on certain pages in blogger


THIS IS A DO FOLLOW BLOG --- ADD YOUR COMMENT

Article Written By Sushant Risodkar

Yo! I'm +Sushant Risodkar (noteeboyz.13@gmail.com) & my nickname on web is Typhoon. I'm a 18 yrs. old young blogger from India & the owner of SmartBloggerz. If you are looking for SUCCESS as a blogger & affiliate marketer then SmartBloggerz is the right blog for you. You can follow me on Twitter or be my friend on Facebook. And hey! Don't forget to LIKE SMARTBLOGGERZ on Facebook. Read more .

Sushant Risodkar has written 372 superb article(s) on this blog


{ 26 comments… read them below or add one }

MK adida January 19, 2009 at 2:48 pm

Hi again!

Actually i was mentioning the ad that is in the post in this picture: http://daryl.simb.googlepages.com/adonpost.jpg

Anyway thanks for this tip. It helped me!

Reply

Typhoon January 19, 2009 at 3:28 pm

ohh..ok..By the way it’s almost the same thing which I have used i.e Conditional Tags ;)

Reply

MK adida January 20, 2009 at 11:02 am

Hi again…

I seem to have problem making it. I don’t know how. Actually I wanted to just put some ads at the top of the page, to make it look more nice. Would you mind if you give me the particular section of the code and so I could paste it on my blog?

I don’t mind if I don’t get any money, and anyway I didn’t start this blog to earn money.

Thanks

Reply

Typhoon January 20, 2009 at 3:20 pm

@MK adida

Hey just send me the mail with your blogger account info and with the screenshot where you want put that thing plus the script code in a text file..I will do it for free :)

Reply

J. February 5, 2009 at 12:37 am

Is it possible to display a widget under “Post Pages with disallowed comments” only?

Reply

Typhoon February 5, 2009 at 10:33 am

I think yes..

Reply

kevin March 7, 2009 at 6:15 pm

is it possible to add something to a post only if it’s labeled with a specific label?

Reply

Typhoon March 7, 2009 at 6:37 pm

Currently It is not possible..You can only show widgets in the sidebar or somewhere else having specific labels but in the posts.

Reply

kevin March 9, 2009 at 12:14 am

hmm, ok, can you point me in the right direction on how to do this? also, can you use the url of a specific web post? i want to add the digg badge to only posts with a ‘digg’ label and not every single post.

Reply

Typhoon March 9, 2009 at 1:33 pm

Sorry, but that thing is not possible as yet.

Reply

ec April 17, 2009 at 2:53 pm

Hi,
Thank you for the codes on “Display widget On Specific Page/URL Only”, it was wonderful !

But, I am unable to implement codes on “Display widget On Specific Label Page Only”, appreciate if you can give a clear example on how to write the http://…….. in this codes.

Thanks!
ec

Reply

Typhoon April 17, 2009 at 3:00 pm

Hi ec,
I came to know your problem. If you could send me your blogger info or provide admin privileges to my email noteeboyz.13(at)gmail.com then I would be able to do it for you.

I can not paste all the coding n all that here because I am damn busy right now. And I love doing things practically.

Reply

ec April 17, 2009 at 4:28 pm

Maybe this can help you determine the problem:
xml version=1.0
encoding=UTF-8
Template name=Minima Black

Sorry for trouble you!
ec

Reply

Typhoon April 17, 2009 at 4:44 pm

This is not important. It could be possible in any theme(almost). As I said in the earlier comment I would be happy to do it practically rather than messing the codes in here.

Reply

ec April 17, 2009 at 5:14 pm

Now I understand, it must be click on “Label” and not click on post which with the specific label.
I using this blog for test: http://timeavenue.blogspot.com/
If you click on label widget link called “XYZ”, the “test 4″ widget will appeared. If you click on “3rd Page – XYZ” (label with “XYZ”) under the “Link” widget, it wont appeared.
So now my problem is actually want it to appear when I click on any page link which with the specific label name?
Much appreciate for your times to give me help!!
ec

Reply

Typhoon April 17, 2009 at 5:20 pm

Ok so you wanted to make your widget appear on posts with specific label; which I clearly said is not possible as of now in my earlier comments. You can only show widgets on specific label page only.

Reply

ec April 17, 2009 at 5:25 pm

Sorry, my previous reply maybe a bit messy! clearer reply below:

Now I understand this codes is for click on “Label” link and not for the “Post” link.
I wish to have a code for “Post” link which can call out the “widget” under certain “Label” condition.

Hope this is more clearer!
Thank again!
ec

Reply

Typhoon April 17, 2009 at 5:34 pm

Ya ec; I understood from your earlier comment properly. And as I said it is not possible as of now. If it gets discovered I will be surely writing it up.

Reply

ec April 17, 2009 at 5:33 pm

Oops ! OK, Thanks, hope it can be done in future :)

Cheers!
ec

Reply

sbunting108 June 25, 2009 at 3:48 am

I think I may try this when i ahve some free time. Thanks
.-= sbunting108´s last blog ..Llandudno =-.

Reply

charlie September 22, 2009 at 1:04 am

Hi Typhoon,

Thanks for this great info. Was working just great on my blogspot blog, but then I just changed to a custom domain and my pictures, which I had appearing on seperate pages, have now all disappeared?!

HELP would be super helpful!

Charlie

Reply

Typhoon September 22, 2009 at 7:09 pm

Mail me your problem describing as much as you can and I will try to help you in that.

Reply

Helena November 29, 2009 at 5:05 am

I can get my widgets to disappear, but I keep getting divider bars with nothing between them. Is there a way to get rid of the dividers too?

Sorry, I tried to read the Comment Policy but the link seems to be broken.
.-= Helena´s last blog ..Andy at 41 weeks =-.

Reply

Typhoon November 29, 2009 at 1:43 pm

Thanks for reporting that broken link..May I have the screenshot regarding the problem you are getting and where it is happening..

Reply

Helena November 30, 2009 at 8:55 am

Ah! Seems to be working now.

Reply

Selina August 21, 2010 at 4:46 pm

Tnx for the help Typhoon.

Reply

Leave a Comment

CommentLuv badge
This blog uses premium CommentLuv which allows you to put your keywords with your name if you have had 3 approved comments. Use your real name and then @ your keywords (maximum of 3)


whos.amung.us