Search This Blog

1 May 2013

To Display/Show/Hide Gadgets/Widgets for Home Blogger

Tutorial [教程] • 1 MAY 2013
Sometimes people desire to show some widgets on few parts of their website, so it unnecessarily does not decrease the speed of other pages. 
Show/Hide/Display Gadgets/Widgets in Blogger
Some times we needs to display or show widgets or gadgets only on home page of blogger or need to display gadgets only on post pages of blogger or need to display gadget in archive pages of blogger. But why we need it to display widget in some specific pages? Suppose you created a featured content gadget and most of blogger display feature content to the top side of blog posts in the home page of blogger and if some body click on any posts then they entered in the post page and they could see the full post and there do not alive featured content gadget on to that post page. 
So it is a good idea for to display your feature content only on home pages of your blogger. So feature content is a case but you can do these for any of your widgets. Let's what will you cover in this post. Thanks and Credited to Technology Feedfury1. 

1.How to display gadgets only on home page of blogger. ( How to hide gadgets from static pages and post pages in blogger. )
2. How to display gadgets only on post pages of blogger.( How to hide gadgets from home page and static pages in blogger. )
3. How to display gadgets only on static pages of blogger. ( How to hide gadgets from home page and post pages in blogger. )
4. How to display gadgets on post pages and static pages of blogger.( How to hide gadgets from home pages in blogger. )
5. How to display gadgets on home page and static pages of blogger. ( How to hide gadgets from post pages in blogger. )
6. How to display gadgets in home page and posts pages of blogger. ( How to hide gadgets from static pages in blogger. )
7. How to display gadgets only on archive pages of blogger.
8. How to display gadgets only on a specific page of blogger.
9. How to display gadgets except one specific pages of blogger.

Firstly go to your Blogger dashboard --> Design --> Edit HTML (  Expand Widget Templates )  and now you have to find html codes corresponding to your gadget which want you hide or display. So find the code (using ctrl+F) <b:widget id='HTML but this code is common for your every gadgets so how will you distinguish amoung all gadgets? Let's find how? The whole line associated with the above code will be as follow,

<b:widget id='HTMLx' locked='true' title='Your Title' type='HTML'>

where x can be any integer and for every gadget the value of x will be different and you can see title for every gadgets html code as above code Your Title so basically title is your gadgets name which had you set by creating your gadget so if you don't choose any name in the gadget then it will be blank as title=''  . so now choose which gadget you want to display or hide in any specific page just give a title to that gadget and then find the code <b:widget id='HTML which will be corresponding to your title ( taken a name to gadget is only for finding the proper gadget html code purpose only so after hide your gadget you can delete your title name easily as you does). Now you can easily find your gadget html code which will be like as follows,

<b:widget id='HTML19' locked='false' title='Temporary name' type='HTML'>
<b:includable id='main'>
<!-- 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'/>
</b:includable>
</b:widget>

Now you have to add some portion into the above code as I am adding by blue text area in the following code,

<b:widget id='HTML19' locked='false' title='Temporary name' type='HTML'><b:includable id='main'>MY FIRST LINE CODE<!-- 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'/></b:if></b:includable></b:widget>

1 How to display gadgets only on home page of blogger. ( How to hide gadgets from static pages and post pages in blogger. ) Replace MY FIRST LINE CODE with 
<b:if cond='data:blog.pageType == &quot;index&quot;'>

2 How to display gadgets only on post pages of blogger.( How to hide gadgets from home page and static pages in blogger. ) Replace MY FIRST LINE CODE with 
<b:if cond='data:blog.pageType == &quot;item&quot;'>

3 How to display gadgets only on static pages of blogger. ( How to hide gadgets from home page and post pages in blogger. ) Replace MY FIRST LINE CODE with 
<b:if cond='data:blog.pageType == &quot;static_page&quot;'>

4 How to display gadgets on post pages and static pages of blogger.( How to hide gadgets from home pages in blogger. ) Replace MY FIRST LINE CODE with 
<b:if cond='data:blog.pageType != &quot;index&quot;'>

5 How to display gadgets on home page and static pages of blogger. ( How to hide gadgets from post pages in blogger. ) Replace MY FIRST LINE CODE with 
<b:if cond='data:blog.pageType != &quot;item&quot;'>

6 How to display gadgets in home page and posts pages of blogger. ( How to hide gadgets from static pages in blogger. ) Replace MY FIRST LINE CODE with 
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>

7 How to display gadgets only on archive pages of blogger. Replace MY FIRST LINE CODE with
 <b:if cond='data:blog.pageType == &quot;archive&quot;'>

8 How to display gadgets only on a specific page of blogger. Replace MY FIRST LINE CODE with 
<b:if cond='data:blog.url == &quot;Your_URL_Here&quot;'>

9 How to display gadgets except any one specific page of blogger. Replace MY FIRST LINE CODE with 
<b:if cond='data:blog.url != &quot;Your_URL_Here&quot;'> 

In the 8th case put your url instead of Your_URL_Here,at which you want to display gadget and in the 9th case you have to put your page url at which you don't display gadget.

6 comments:

Template developed by Confluent Forms LLC; more resources at BlogXpertise