HOW TO SHOW/HIDE BLOGGER WIDGETS ON PARTICULAR PAGES.

 On Kamis, 07 Juni 2012  

When you add a new widget/gadget on your blog,it automatically displays on your blog's homepage,static pagesand post-pages.
Whereas,there are some widget which is not needed in particular areas of your blog.
E.G,Widgets like Recent comments,Related posts,Recent posts,Top commentatorsetc...which are not needed in static pages &sometimes homepage are displayed everywhere,thereby flooding your blog with extraneous widgets.

Fortunately,there are some conditional tags which will help solve this problem.
A Conditional tag consists of two sections of codes i.e,A <b:if+condition> and a matching end tag which is </b:if>

HOW TO DISPLAY/HIDE WIDGETS ON BLOGGER.

  • To display/hide widgets on specific pages,you have to know that particular widget's id first[You can leave a comment below if you don't know how to get it.]
  • Login to Blogger » Design/Layout » Edit HTML.
  • Check the box next to
    Expand Widget Templateand search for the widget's Id.

APPLYING CONDITIONAL TAGS.

On getting the widget's id,you will get something like this»
<b:widget id='HTML1' locked='false' title='' type='HTML'>
<b:includable id='main'>
CONDITIONAL TAG GOES HERE <!-- only display title if it's non-empty -->
<b:if cond='data:title != &quot;&quot;'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>

<b:include name='quickedit'/>CLOSING TAG.
</b:includable>
</b:widget>

Below are the conditional tags to replace with the ones in the widget above.

TO SHOW A WIDGET ONLY IN HOMEPAGE.

<b:if cond='data:blog.url == data:blog.homepageUrl'>

SHOWING WIDGET ONLY IN LIST PAGES.

<b:if cond="data:blog.pageType == "index"">

SHOW WIDGET ON ONLY POST PAGES.

<b:if cond='data:blog.pageType == "item"'>

SHOW WIDGET ON A SPECIFIC PAGE.

<b:if cond='data:blog.url == "URL OF PAGE"'>

SHOW WIDGET ON ARCHIVE PAGES ONLY.

<b:if cond='data:blog.pageType == "archive"'>

SHOW WIDGET ONLY ON STATIC PAGES.

<b:if cond='data:blog.pageType == "static_page"'>

SHOW WIDGET ON BOTH POST & STATIC PAGES.

<b:if cond='data:blog.url == data:post.url'>

SHOW WIDGET ON ONLY LABEL-SEARCH PAGES.

<b:if cond='data:blog.searchLabel'>

NOTE:-Whenever you use any of the codes above,do not forget to include the matching end tag,i.e </b:if>

ENCOUNTERED ANY DIFFICULTY?
DO NOT FORGET TO LEAVE A COMMENT BEHIND!!!
HOW TO SHOW/HIDE BLOGGER WIDGETS ON PARTICULAR PAGES. 4.5 5 Unknown Kamis, 07 Juni 2012 When you add a new widget/gadget on your blog,it automatically displays on your blog's homepage, static pages and post-pages. Whereas,t...


Related Post:

  • HOW TO ADD “ONLINE HTML CALCULATOR” TO BLOGS.Here's a quick tool-script you can add to your website/blog to display online calculator.Once a number or sign is clicked on,the page reloads with the option in the text area.Here's a demo of this online application. … Read More
  • HOW TO ADD A “PRINT PAGE” BUTTON TO BLOGGER BLOGS.Adding a “Print Page” button to a blog is another way of generating little traffic to it,as visitors are given the option to print an entire article without stress,and by so doing can boost the traffic of your blog through Word-of-mouth,online forums… Read More
  • AWESOME FACEBOOK LIKE,STUMBLE,RETWEET & DIGG COUNTER WIDGET FOR BLOGS.Here's another cool Share-buttons widget for blogs. It's a 4-in-1 share widget with an awesome look and counters.Well,I must confess,this is one of the most widely-used Social-media widget in the Blogosphere.It includes the Facebook Like button,Digg … Read More
  • HOW TO ADD HTML ENCODE/DECODE TOOL WIDGET TO BLOGS.There are times whereby you might need to post an Html tag as plain text most especially for bloggers in “Blog niches”.It is also needed when a visitor has to write some codes in the comment box.Although,Blogger has really made it easier to post “htm… Read More
  • RANDOM BANNER WIDGET FOR BLOGGER BLOGS.There are so many reasons you might want to add a banner to your blog site.Adding a “Random banner widget” makes it better for any website.It helps to manage space and is very useful in promoting affiliate links.So in this tutorial,I'll be giving you… Read More

Tidak ada komentar:

Posting Komentar