Display Gadgets On The Page Of Only One Post In Blogger




| 17 comments

In a recent post we looked at how to display gadgets and widgets on only the home page or the post pages of your blog.The effect could give both your home page an post pages a unique look and make the most of the space on both.

A comment on that post from Kate asked the following :

Is there a way to make a gadget appear on only ONE of the extra "Pages" that Blogger allows us? Or, a way to add a gadget to one Blog Post that I can create a hyperlink to?

I looked at using a similar technique as in the other post and it worked, So The answer is Yes You can display gadgets on only the page of a specific post, great question and here's how it's done.

Post Specific Gadgets In Your Blog

Step 1. You must first have the post published and then add the gadget as normal.

You will have to find the gadget in your blogs html so make sure to give it a unique title.You should give it the title xxxxx and later change this or remove it.You will also need the URL address of the post you want the gadget to be available on.The URL is the address that appears in the address bar at the top of your browser.

Once the gadget is added you can move to the next step.

Step 2. In your dashboard Click 'Layout' > 'Edit Html' > Tick the 'Expand widget templates' box


Blogger layout

edit html blogger

Expand widget templates blogger


Step 3. Now you want to find the gadget in your template so you look for the title of your gadget or xxxxx if you used that name.

(The easiest way to do this is to click 'CTRL and F' for a search bar to help find the code - for more info on this Click Here.)

Step 4. Once you find the gadget it will look similar to the code below you can see the title xxxxx, the code displayed here is the entire code for the gadget :

<b:widget id='HTML1' locked='false' title='xxxxx' type='HTML'>
<b:includable id='main'>
<!-- 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'/>
</b:includable>

Note: For some gadgets like your archive, the section will be larger but you want everything between :

<b:widget id='HTML1' locked='false' title='xxxxx' type='HTML'>

And

</b:includable>

Step 5. Now we have the code for the gadget we have to add two pieces of code to make it display on only one post.

Copy the code in red below and add it to the positions as shown :

<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == "PUT-THE-POST-URL-HERE"'>
<!-- 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'/>
</b:if>
</b:includable>
Now replace PUT-THE-POST-URL-HERE with the URL of the post you want the gadget to be on.

Once you sure you have the code added correctly you can save your template.The gadget should only appear on the page of the post you entered.

Note : You can edit the gadget and change the name from xxxxx or remove the title.

Great question Kate, i hope this helps and I'm sure it's a trick that will help other as well.Here is the link for the post on setting gadgets to post pages and the home page only.

If you ever have a question or a suggestion for a post you can use the comments or the 'Contact me' form I'm always looking for suggestions.


Join over 5000 Subscribers! Please sign up to receive Updates.

SUYB has its Focus on Quality. If we post Crap, you can unsubscribe.

No Spam and No Garbage! - Use RSS, Twitter & Facebook as an Alternative


If You Enjoyed This Post Please Take 5 Seconds To Share It.

17 comments:

  1. Hi Paul!
    I tried this, but I don't have the same code as what you are showing. I can see where to put the URL, but I can't figure out where to put the . I keep getting a error "Element type "b:if" must be followed by either attribute specifications, ">" or "/>". I can give a snap shot of the code here:
    http://cid-172fefd1981cd7b5.skydrive.live.com/self.aspx/.Public/One%20Post%20Page%20Only.doc

    ReplyDelete
  2. Hi kate,

    What type of gadget are you trying to add to one post only, and what effect are you trying to achieve ?

    The gadget in the code has the title Recent Posts but exactly what is it.I know the code i showed in the post is working but the only gadget similar to the one in the code you sent me is the actual blog comments..

    Let me know,

    Paul.

    ReplyDelete
  3. Hi Paul! It's an actual gadget called "Recent Posts" on Blogger (Built by Blogger Busters). I placed the gadget on the header and would like to have it show only when I hyperlink to a Post Page called Table of Contents.

    ReplyDelete
  4. Hi again kate,

    There should be no problem with that gadget so the code must be entered wrong.No problem,find the gadget code in your template but dont change it sent it to me - send it to me by the 'contact me' form and i will take a look.Hopefully i can set it up and send it back.

    Paul.

    ReplyDelete
  5. An another cool and useful post :)

    ReplyDelete
  6. hye! make it short. so how about moving the followers gadget to pages? could you please post a tutorial about this?

    ReplyDelete
  7. Great post...
    Is There Any Way 2 make search box that searches specific section of blog...to narrow searches.

    ReplyDelete
  8. Great post
    i used it alot but i found problem at my blog after using it i found an empty palace reserved for this gadget on other posts

    (i used specifi gagdet for specific post so this error or empty place for this gadget appear on other post)

    how can i remove this empty palace ???? my blog "feelsoka blogspot"

    ReplyDelete
  9. I have no word to say. Only I can say that you are the Boss.
    Thanks for this great post.

    ReplyDelete
  10. First off, I haven't tried these tricks yet, but I really hope they work because they will be a life saver. :)

    Secondly, is there a way to show widgets only on posts with certain labels? Example: I have Widget A and I want it to only show on posts with Label A, but not on any other posts or pages.

    ReplyDelete
  11. Thank you so much once again for this. A Big Big help! All the best :)

    ReplyDelete
  12. Great posts in your blog. I subscribed!

    I have a question, though, that I cannot find the answer to...

    I want to use my ShareThis gadget in all my posts and on my homepage, but I want to exclude it from my About Me page as well as my Archives page. Is there a way to place exclusions somewhere in the html?

    www.orileaoutloud.com

    Thanks for any help you can provide!

    ReplyDelete
  13. My question is this. I was able to get this working perfectly, but if I wanted 2,3,4,or 5 specific pages to show that gadget how would I do that. I tried adding another
    b:if cond='data:blog.url == "PUT-THE-POST-URL-HERE"'
    below the first one like
    b:if cond='data:blog.url == "1st-POST-URL-HERE"'
    b:if cond='data:blog.url == "2nd-POST-URL-HERE"'

    and then an extra /b:if right below the other one. I didn't get any message saying that the template isn't well formed, but it does ignore all of it. So can this selective display of a gadget be used for multiple url's?

    BTW, nice post.

    ReplyDelete
  14. Disregard my last message, I figured it out by adding all the content between
    b:if cond='data:blog.url == "PUT-THE-POST-URL-HERE"'
    Random Code
    /b:if

    Like this

    b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'
    b:includable id='main'
    b:if cond='data:blog.url == "1ST-POST-URL-HERE"'
    Random Code
    /b:if
    b:if cond='data:blog.url == "2ND-POST-URL-HERE"'
    Random Code
    /b:if
    /b:includable

    I left the <...> of the above code to make sure it posted.

    ReplyDelete
  15. Thank you so much! I found this after someone in the blogger help forums linked to you, this is lovely!

    One more question: how would you modify the code if you wanted a gadget to NOT appear on only one page? For example, I do a fair amount of book reviews on my blog, and I used your above tutorial to make it so that a gadget that organized the book review posts by tags (or labels, as blogger calls them) only appeared on a page I called "Book Reviews by Tags." (I have another page of "Book Reviews by Author," but I did the links on that one manually, without a gadget.)

    Now, there are a bunch of things in the sidebar on my home page which probably don't need to be on the "Book Reviews by Tags" page, from an "About the Blog" to my archives. It'd be less cluttered if I didn't have them all there. But I don't want to get rid of them everywhere but my home page -- I still want them on the post pages, especially since I get a lot of people linking in to specific posts from other places, and I want them to still see my blog description and everything. So is there a way to do that, to exclude just one page from the widgets, or to tell them to display on the home page AND on posts, but not on other pages?

    ReplyDelete



Important - If you ask a question make sure you tick the "Notify Me" box below the comment form to be notified of follow up comments and replies.


Hire Us