Today I added the ability to display expandable posts on my blog. What's an expandable post? Let's take a step back and talk about posts. A blog post is another name for an article written for a blog. Normally all articles, or posts, appear in full on the main page. An expandable post is a post that displays a summary on the main page, and offers a link to another page for the full article. For example;
Expandable posts keep things cleaner on the main page. I plan to use them for the larger posts (articles).
For my fellow Google-Blogger blog users out there, here is how I built my expandable post capability;
1. From the Layout Tab of your Blogger Dashboard, Select Edit HTML.
2. Make a backup copy your Template. This is critical. Changing your template incorrectly can be detrimental to the health of your blog!
3. Check the Expand Widget Templates box.
See the graphic below for a summary of Steps 1-3.
4. Within the HTML, find the code;
</head>
5. Right before the </head> tag, past the the code from <THIS PAGE>.
6. Look for the code <data:post.body/>.
7. Replace it with;
<b:if cond='data:blog.pageType == "item"'>
<style>#fullpost{display:inline;}</style>
<p><data:post.body/></p>
<b:else/>
<style>#fullpost{display:none;}</style>
<p><data:post.body/></p>
<span id='showlink'>
<a expr:href='data:post.url'>Read More...</a>
</span>
<script type='text/javascript'>
checkFull("post-" + "<data:post.id/>");
</script>
</b:if>
8. If you are using a standard blogger template, you may need to perform this step.
- Find <div class='post-body'>
- and change to <div class='post-body' expr:id='"post-" + data:post.id'>
9. Lastly, from the Setting, Formatting menu, add this code to the Post Template Box
Type Your Post Summary Here
<span id="fullpost">
The Remainder of Your Post Goes Here
</span>
For example;
Now each new post will be ready for a Post Summary section and a Post Remainder section.
Special thanks to Ramani at Hackosphere.com for this tip! If you decide to use this tip on your blogger blog, be sure to add a link to Hackosphere to your sidebar in return.
17 comments:
thank you!
this is the only expandable post hack that has ever worked for me
cheers :)
worked for me too, but is there any way to keep it from showing "read more" when there is nothing below the fold?
watercat, no way that I know of other than either manually putting in the SPAN tag or not putting in the SPAN tag.
Wow thanks for the expandable post tutorial!
I tried 6 or 7 tutorials and yours was the only one that worked for me.
Thanks pal. I apppreciate it
Thanks! Worked like a charm!
Hi this still works the same way right? It opens a new page that only shows that 1 post it doesnt actually expand open on the page?
Mkcoy, correct, it does not expand on the open page. It opens the full article on a new page.
Thanks for the help but even when I don't want the "Read me" link it automatically comes up. I haven't even entered the (span) but the read me link shows up. Is there some way to remove it.
Kisnet,
My experiece has been that the Read More… only appears when I add the starting SPAN tag. For example span id="fullpost". Without the opening SPAN tag, you should not get the Read More… prompt on your posts.
I hope this helps.
Thanks Tim for the help but Even when I don't enter the span id="fullpost" the Read Me post automatically comes up. I have tried on my test blog and it still shows up. for eg. http://kiskisnet.blogspot.com/
Thanks! I loved your tutorial! I tried a lot of other tutorials but this one actually worked. A lot of others teach how to put expandable posts on the "classic templates".
Thanks again!
- HM
www.tufblog.co.cc
Thank you so much! I have tried other expandable post tutorials and this is the only one that has worked!
I hope this will make it simpler.
How to create expandable post in Blogger
THANKS it worked,but its showing two read more.
www.metheautomaniac.blogspot.com
hi!
thank a lot for the tip!
but i have the same problem with "read more.." even without span tags!!
please help!
yours,
kay
to your information:
************************************
this is all absolutely outdated since blogger has the "insert jump break" feature implemented!!
************************************
Post a Comment