An Important Update

Dear Followers Of This Blog ...

If you did not use a Blogger / Google account when you Followed this blog, years ago, you are probably not Following now . During the past...

Sunday, August 09, 2015

HTML Based Accessories, For Individual Posts

Blog owners are constantly asking how to add post specific accessories, from third party services.
How do I add a Like button, for my posts?
Adding many post accessories requires adding XML code, to the post template.

Adding code to the post template is scary - and it can cause problems, when incorrectly done. The easiest way to add a per post accessory is to add an HTML gadget that references the post by the URL, as displayed for the page.

The problem with an HTML gadget is that it simply references the page displayed. If your posts are read from the main page, or an archive page - and somebody uses a Like accessory, what happens?

A Like button, used from an HTML gadget with the main page displayed, applies to the blog - since it's the main page that's displayed.

If you want your readers to Like your individual posts, they need to use the Like button with the post page displayed. You need three tweaks, for this to work best.
  1. Use Jump Break on the posts.
  2. Tweak the Like gadget, so it only displays in a post page.
  3. Add a second Like gadget, in the sidebar, to apply to the blog.

Use Jump Break on the posts.
With Stats displays and main page content, you get the most accurate post pageview counts when your readers read each individual post. Similarly, encouraging your readers to Like your individual posts will be more successful when the Like is used from the post page.

A Jump Break, added to each post, will encourage the reader to click to the post page, where the Like gadget will be visible, immediately beneath the post. Clicking on the button in the gadget, the Like is applied to the post.

Tweak the Like gadget, so it only displays in a post page.
If you want reliable individual post Likes, you want a Like gadget that is only visible from the post page. You can add a CSS tweak, using the Template Designer "Add CSS" wizard.

Add a second Like gadget, in the sidebar, to apply to the blog.
You can have Likes that apply to a main page - but what happens when a non home, index page is displayed? Have you ever looked at the non home URL, for a secondary main page segment?

Add a second Like gadget, in the sidebar, to pick up the home page of the blog, instead of the current page. Then, tweak that gadget, so it only displays on an index page - again, using CSS.

And, you're done.
When all of this is done, you'll have two Like gadgets - one that applies to the blog, the other to the individual posts. And your readers will read each post from the post pages. And you'll do all of this, without tweaking the post template.

Dude, hit me with a comment!