Blogger hack: Expandable posts with Peekaboo view  

Posted by T ZAMAN in ,

Your blog's main page usually shows the entire content of each post. If your posts are usually more than 2 paragraphs, then your visitor will find it difficult to quickly find the topic of interest to him because he needs to scroll down a lot. This is where expandable post summaries helped in the old Blogger. This hack serves the same purpose for the new Blogger and more! That is, main page will show only post summaries and when you click "Read more", the full post appears in the main page itself (Peekaboo view)!! I got some requests to do such a hack and I managed to get it working. Later, Hans improved it by adding a "Summary only" link with which you can collapse the post back to summary. Together, we also made the "Read more" link to show up only for the posts that have a summary. This is an amazing hack but you need to be careful while changing your template. If you are not familiar with HTML, I strongly suggest you to get help from somebody who knows HTML while applying this hack. Here are the steps to follow.

Step 0: Download and save your template so that you can go back to it if there is any problem with this hack (Important!)

Step 1: Find the

tag in your template and add all the code from this page before it.

Step 2: Find the includable called 'post' and copy/paste the changes highlighted in red in this page (Be very careful and avoid mistakes. Note that the word "uncustomized-post-template" may not appear in your template but that's fine.). To find the includable, you could search for the term id='post'. If you are not able to find it, you may not have expanded the template. Select the checkbox named "Expand Widget Templates", which is right above the template code, to expand it into more code.

Step 3. Goto Settings->Formatting and at the bottom, you will find the text box provided to specify the "Post template". Copy/paste these lines into that text box and save the settings. (Please DON'T type these lines yourself because you might introduce some spaces that will break the functionality)

Type your summary here

Type rest of the post here


If you create a new post now, it shows you clearly where to type the summary and where to add the rest of the post. It is important to make sure that the /span tag above is at the end of the post. To ensure this, use Edit Html tab instead of Compose tab while typing the post. After typing, you can go to compose mode and change fonts/colors etc. Please note that you could also divide some (or all) of your old posts into summary and full post by editing them. The "Read more" link will appear only for the posts that have been divided like this.

[If you are visiting my blog for the first time, don't miss these other nice things I offer:
1. A Digg-like blog sharing website to promote your blog - bvibes.com.
2. AJAX-driven fast template - Neo ]

Important notes:
Note 1: Please don't forget to add a link to Hackosphere in your sidebar. That's the only thing I am expecting in return :)
Note 2: If you would like some fade in/fade out special effect for this hack, you can have it by making the few changes described in this other post.
Note 3: If you would like the "Read more" link to take you to the post page instead of expanding in the main page itself, use this other hack.
Note 4: If you click "Older posts" link, the "Read more" link may appear even for the posts which you haven't divided into summary and full post. This is a known problem which we haven't solved yet.

Get a Prepaid Visa Card - No credit check. Quick approval. Shop online, pay bills, use ATMs





Type your summary here

Type rest of the post here

http://in.boobies.com/c/fmp.cgi/8001/2165461.yu567fsdfed/A

SEARCH THE WEB

PLEASE READ THIS

This blog is intended for educational use. All data presented on this website were gathered from outside sources and no files are actually hosted in this website. The owner of this site shall not be held responsible for how the site visitors use the information provided here.

DONATE NOW

Top Commentators

Widget by Blogger Widgets

Recent Posts

Archives

Subscribe

BlogUpp!

FEEDJIT Live Traffic Feed

NeoCounter