Monday 1 April 2013

How to Make a Widget Only Show Up on the Main Page in a Blogger

Leave a Comment
How to Make a Widget Only Show Up on the Main Page in a Blogger
When you have multiple pages in your Blogger blog, you may find an instance when you want certain widgets to show up on the main page, but not on the other pages. Whether it's to clear the clutter, reduce repeats of information that's already listed on the page or for some other reason, accomplishing this task requires you adjust some of the HTML code on your blog.

  1. Log into your Blogger account and click "Layout" from the "Dashboard."

  2. Locate the widget you want to hide from the list of items in the blog's sidebar. Click "Edit" to open it.

  3. Click the URL that appears in the popup box until you get to the end. Look at the last word or group of words that follow the final "=" sign. Depending on the widget, this may be something like "Profile1" or "Image2." Make a note of these words -- they're the identification for your widget. Click "Cancel" to close the widget.

  4. Click "Edit HTML" at the "Template" page.

  5. Click "Download Full Template" from near the top of the page. Since you are going to be altering your HTML template, you want to make sure you have a backup just in case you mess something up.

  6. Click the "Expand Widget Templates" box, and then scroll through the HTML code under "Edit Template" until you find the identifier code you identified when you opened the widget in step 3. Your widget code should be preceded by text that reads "<b widget id=".

  7. Look for the code that reads "b:includable" somewhere after your widget's identifier. Type the following code right after that text:

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

  9. Scroll a bit farther down until you find the "</includable>" code. Type below code just before it.

  10. </b:if>

    Example:
    <b:widget id='HTML1' locked='false' title='Profile1' type='HTML'>
    <b:includable id='main'>
    <b:if cond='data:blog.url == data:blog.homepageUrl'>
    
    Widget Code Here
    
    </b:if>
    </b:includable>
    </b:widget>

  11. Click "Save Template" at the bottom of the "Edit Template" box.

If you do mess up your template, go to your "Downloads" folder and copy the code as it appears in the file you saved. You can then delete the code that appears in the "Edit Template" window and paste in the code you saved.

0 comments :

Post a Comment

Related Posts Plugin for WordPress, Blogger...