Sunday, February 1, 2015

Making a Gadget Visible only to the Blog Admin!

Blogger Tips and Tricks
There are several post I had shared related to Blogger tips and tricks earlier in this site. And today I'm gonna share another important post on Blogger. You may have already get the idea about this post content from the title of this post. Actually this post is very much exclusive as because the trick that I am share in this post is mostly used by the Professional and high profile website. So, lets know something more about Making a Gadget Visible only to the Blog Administrator.

A Website or Blog Admin use several gadgets on his site. But sometime you may want to make any one of your site's gadgets only visible to you and not to your visitor. Basically when the admin set any kinds of Survey or Countdown gadgets on his site he don't want anyone else to see that gadgets until the final result is ready. As the best example of this trick I can take the name of Online Voting gadgets used Online News site.


Actually the procedure of hiding a gadget on Blogger is very simple. You just have to add two lines to the gadget that you want to hide. And you will have to add the code inside your Blogger Template. OK lets see how to do the trick.

Warning: Before doing any kind of customization on your site's HTML page, I will recommend you to backup your site Template. To know more about Template backup Read This Post

  • First Sign into your Blogger Account and go to Dashboard.
  • Then click on Template and then click on Edit HTML button. You will land on the HTML page.
  • Here in this HTML page Search for the Gadget code that you want to hide.
Example: A HTML/JavaScript code will be like the following one.
 <b:widget id='HTML1' locked='false' title='' type='HTML'>  
 <b:includable id='main'>  
 <span class='item-control blog-admin'>  
 <!-- 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'/>  
 </span>  
 </b:includable>  
 </b:widget> 

Note: So, all you have to add the Red line the gadget as shown in the above. Now all the gadget have the same structure like the above example, but it will be easier to guide you, just place the first code in Red just after <b:includable id='main'> and second Red code just before </b:includable>. To look look inside the widget's code, click on the sideways arrow next to the widget's id. 

  • Finally click on Save Template button to apply the change.


As the application of this change when you view your Blog without signing in that gadget will not be visible to you, but as soon as you sign in you will see that it is visible to you.


Stay with www.iTTimesbd.com for more IT related post

2 comments: