Free Blogspot templates

How to show-hide sidebar widget


How to make so, that the part of contents would show on the main page and disappeared on associate pages. For example on this blog the section BLOGS is visible only on the main page.

For this You should do the following:


  • Open Template -> Edit HTML tab
  • Set checkbox Expand Widget Templates
  • Find bigining of fragment that you are going to hide in the HTML. In this example that is: <b:widget id='HTML1' locked='false' title='Blogs' type='HTML'>
  • Inser after <b:includable id='main'> the next code:<b:if cond='data:blog.pageType != "item"'> and </b:if> before </b:includable></b:widget>
  • Save template

All code for this example: <b:widget id='HTML1' locked='false' title='Blogs' type='HTML'>
<b:includable id='main'>

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

<h2 class='title'></h2>

<div class='widget-content'>

<data:content/>

</div>

<b:include name='quickedit'/>

</b:if>

</b:includable>

</b:widget>


There is no necessity more to edit html code at desire to change contents of this widget.

0 comments: