![]() |
Or you might have an animation header, that you would like to appear different on the home page.
You might want some gadgets only appearing on the Archive page, or on the About page.
Just follow this simple tutorial:
Add the widget (widget, gadget and page element are the same exact thing, in Blogger), to where you want.
Then, open the widget to it's edit form window, and maximize the window.
At the navigation bar, appears a link, look at its last few words.
there it will say your gadget's ID (ex.: 'HTML7') , make sure to remember it.
Close that window.
Go to Template>Edit Html. Click proceed. Do Not Tick 'expand widget templates'.
Search for your widget's ID (ctrl+F). It should look like this:
<b:widget id='HTML7' locked='false' title='' type='HTML'/>
</b:section>
Good, now tick 'expand widget templates', now your widget should have became a huge piece of code, that looks like this:
depending on the widget type, that is how long it's code will be.
The blue lines are the ones you will need to include, these will place you code inside an "Include/exclude only if on X page..." situation.
You will always include the first blue line after the 'includable id...' and the second blue line before 'includable..' for instance:
To display the Widget only on Home Page
To display the Widget only in Home Page
<b:widget id='HTML7' locked='false' title='' type='HTML'>
<b:includable id='main'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:includable>
</b:widget>
</b:section>
depending on the widget type, that is how long it's code will be.
The blue lines are the ones you will need to include, these will place you code inside an "Include/exclude only if on X page..." situation.
You will always include the first blue line after the 'includable id...' and the second blue line before 'includable..' for instance:
To display the Widget only on Home Page
<b:widget id='HTML7' locked='false' title='Widget Title Name' type='HTML'>Only the first line will change. Here are the options of Inclusion/Exclusion:
<b:includable id='main'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<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>
To display the Widget only in Home Page
<b:if cond='data:blog.url == data:blog.homepageUrl'>To display Widget only in all Post's Pages
<b:if cond='data:blog.pageType == "item"'>To display Widget only on Static Pages
<b:if cond='data:blog.pageType == "static_page"'>To display Widget only in Archive Pages
<b:if cond='data:blog.pageType == "archive"'>To exclude the widget from any of the above:
Put the same two lines, in the same places etc. The only change you will be making is a minor one, in the first line.
<b:if cond='data:blog.pageType != "item"'>instead of
<b:if cond='data:blog.pageType == "item"'>Enjoy!
2:45 PM
zvi

Posted in:
0 comments:
Post a Comment