Display Gadgets On The Page Of Only One Post In Blogger


| | 12 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.
If You Enjoyed This Post Please Take 5 Seconds To Share It.

Stay Connected With Free Updates

Subscribe via Email

12 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

Asking a question ? Make sure to click the subscribe by email link below the comment form to get notified of replies !