Mastering Selective Display Of Blogger Widgets On Blogger Homepage.

Here is also a actually very little tutorial on the thanks to show your blog's widgets selectively on your pages.


Let's suppose you merely would like to point your Profile device on your blog's Homepage, but not on the alternative pages. this could be but it's done.

Step 1: copy your model

Go to your blog's Layout Page, and enter HTML-edit mode. transfer your example as Associate in Nursing XML-file and store it throughout a secure place. simply just in case template-hacking takes a wrong flip somewhere, you will transfer your template-file yet again and you are back to ancient.

Step 2: Locate the Profile Widget

Enlarge the widget-code by checking the checkbox on the HTML-edit page. Now scroll down and look for the Profile Widget, that looks like this:

<b:widget id='Profile1' locked='false' title='About Me' type='Profile'>
<b:includable id='main'>
<b:if cond='data:title != &quot;&quot;'>
<h2><data:title/></h2>
</b:if>
<div class='widget-content'>
...
...
</div>
</b:includable>
</b:widget>


Step 3: Modify the widget code

Now we only want to display this widget if the page that we are looking at is our blog's Homepage. We will use a <b:if>-statement to check for this situation.
Insert the following (red) lines of code into the widget code:

<b:widget id='Profile1' locked='false' title='About Me' type='Profile'>
<b:includable id='main'>
<b:if cond='data:blog.homepageUrl == data:blog.url'>
<b:if cond='data:title != &quot;&quot;'>
<h2><data:title/></h2>
</b:if>
<div class='widget-content'>
...
...
</div>
</b:if>
</b:includable>
</b:widget>


The data field data:blog.homepage URL contains the URL of your blog's homepage. The data field data:blog.url holds the URL of this page. If area unit they're  an equivalent (=) we tend to are on the homepage and therefore the contraption ought to be displayed. If they're not an equivalent, the widget code is skipped.

Step 4: Now save,that’s all.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

More From Webworld