How to Show and Hide Blogger Sidebar Widgets


                          Now  a days,  Blogging  is  more  popular  in  every  where  and  wants  to  look  their  blog  different  than  others.  By  creating  your  own  design  or  downloading  Templates  from  other  source  had  very  known   in  these  days .  Creating  a  template  is  easy  but  every  one  on  the  internet  is  searching  on  how  to  hide  the  widget's   while  viewing  blog  posts . 

Today  i  am  going  to  discuss  about  this  Technique. For  beginners  it  is  difficult  to  edit  their  Blogger  template  but  it's  easiest  if  you  have  a  little  bit  of  experience  with  editing  your  Blogger  template. Before  you  begin,  back  up  your  template .  Do  not  skip  the  backup. Find  Your  Gadget  in  the  Template  Open  your  template  by  clicking  the  "Edit HTML"  button  beneath  your  "Live on Blog" screenshot. 


Now,  use  the  "Jump to Widget"  dropdown  button  to  jump  down  to  your  gadget.
  In  this  example  image,  I'm  choosing  the  widget  with  the  ID  "Image1". 

jump to widget dropdown in Blogger Select  that  ID  from  the  "Jump to Widget"  menu  to  go  straight  to  that  widget's  section  in  your  blog's  HTML. Expand  Your  Widget  Now  that  you've  found  your  widget,  it's  time  to  expand  its  code  so  you  can  insert  the  HTML Code. Click  the  black  arrows  at  the  left  of  the  widget's  code  to  expand  the  code.  Most  widgets  have  at  least  one  bit  of  code  to  unfold,  some  have  2 or 3.  

You  can  stop  unfolding  when  you  get  to  the  closing   </b:widget>  tag  of  your  widget  and  see  that  there  are  no  more  fold  arrows  above  it. Now  that  your  code  is  unfolded,  let  me  show  you  where  to  add  the  conditional  tags. Inserting  Conditional  Tag  No  matter  what  conditional  tag  you  choose,  it  goes  in  the  same  part  of  your  gadget's  code,  so  I'm  going  to  show  you  placement  first.  The  opening  conditional  tag  goes  immediately  below  this  line:

<b:includable id='main'> 

 The  closing  conditional  tag,  </b:if>,   goes  immediately  above  this  line:

</b:includable>  Both  lines  are  highlighted  in  this  image.

 

Now that you know where to put your conditional, it's time to choose your tag!Show Gadget on the Homepage Only If you want to restrict a gadget to your homepage only, use this conditional.Insert the following line below 

<b:includable id='main'>

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

Then, close the conditional by inserting  </b:if>  above  this line  </b:includable>  Press the "Preview template" button. If you see an error message, double check your code and try again. Otherwise, press the "Save template" button to save your changes.Show Gadget on the Homepage and "Index" Pages.The "Index" pages of your blog are the pages readers see when they click the "Older Posts" and "Newer Posts" links at the bottom of the page.

Insert the following line below

<b:includable id='main'>

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

Then, close the conditional by inserting </b:if> above this line  </b:includable> Press the "Preview template" button. If you see an error message, double check your code and try again. Otherwise, press the "Save template" button to save your changes.

Show Gadget on Post Pages Only.This will show the gadget only when your reader is on an individual post page (aka the permalink page). The gadget will be hidden from the home page, index pages, and static pages.Insert the following line below

 <b:includable id='main'>

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

Then, close the conditional by inserting </b:if> above this line 

 </b:includable>

Press the "Preview template" button. If you see an error message, double check your code and try again. Otherwise, press the "Save template" button to save your changes.

Show Gadget on Static Pages Only Static pages are the pages you make in the "Pages" section of Blogger — by default they show up in your top navigation, unless you've specified otherwise.Insert the following line below 

<b:includable id='main'>

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

Then, close the conditional by inserting </b:if> above this line  </b:includable> Press the "Preview template" button. If you see an error message, double check your code and try again. Otherwise, press the "Save template" button to save your changes.


Feel free to  Ask any Questions..