
As announced yesterday, Blogger have now enabled selective post summaries for our blogs. This means we can add a "jump break" in our posts, after which any content will only be visible on item pages.
Those of us using customized templates will probably need to add the code required for this function to work. In this article, I'll explain how easy this is to implement, as well as some helpful hints for customizing the "Read More" link.
Will the "Read More" feature work for my customized template?
For most Blogger users, adding the code required for Blogger's post summaries will enable selective summaries without error, even if you've already added the code to summarize your posts using the <span class="readmore"> hack.The only templates this method will not work with is those which have added an automatic post summaries hack, which summarizes the posts based on the number of characters or words. This is because such customizations ignore any code added to the body of our blog posts and don't register Blogger's Jump Links.
If you'd prefer to use Blogger's Read More function than your current automatic post summaries, the simplest way to adapt your template is to remove references to the post summaries script - anything between the <script> and </script> tags used for your particular method.
If in doubt, refer to the author of the particular version of this script you are using.
How to add the code required for Blogger-powered post summaries
In order to add the "Read More" function to a customized template, we only need to add a few lines of code to our template's HTML.If you're adding this code to your blog template, it is best to first add a new (or test) post in which a Jump Link is added. This ensures we can check our template customization to ensure everything works well beore saving.
To add a blog post with a Jump Link...
Simply create a blog post using Blogger's new post editor. This can be done either through Blogger in Draft, or by enabling the new post editor in the Settings>Basic tab of your Blogger dashboard.Alternatively, you can edit your post in Edit HTML mode, and type
<!-- more --> where you'd like the jump link to appear.Ensure you have some content both above and below the Jump Link. Then publish your blog post.
If Jump Links have not already been enabled in your template, the post will appear in full. In this case, continue reading to learn how to add the code for Jump Links to your Blogger template code.
To add the code for Jump Links functionality to your Blogger template...
Go to Layout>Edit HTML in your Blogger dashboard and ensure you have checked the "Expand widget templates" box.Then using your browser's search function, locate the following line of code:
<data:post.body/>
Depending on your individual template, you may find this enclosed between <p> or <div> tags. We need to leave these tags intact.If you've added any other "Read more" hacks to your template (or have added other conditional statements to the Blog Posts section), you may discover more than one instance of
<data:post.body/>. If this is the case, you need to edit the section which has <b:if cond='data.blog.url != data:blog.homepageUrl> a line or two above this.





0 comments:
Post a Comment