Thursday, October 16, 2008

Testing expandable posts

One thing that happens when you blog is the tendency to write long entries. There are ways to shorten these posts and provide just a short summary, such as just this.

If these directions are accurate, then this will only appear after you have selected "read more". If not, then this will just look silly. Bear with me while I test this out.

UPDATE: Success! For those stuck, here are some tips:
  1. If you use default Blogger templates you will need to add the
    <script>
    and
    </script>
    tags into the appropriate section.
  2. The
    <data:post.body/>
    you are looking for only emerges if you select the "Expand Widget Templates" option on the Edit HTML menu.
  3. Lastly, if you are looking for HTML codes to type in brackets without them disappearing (like I was trying to do with this post), this site was very useful.

UPDATE #2: I noticed that all my old posts were also including the "read more" link even if there was nothing further to read. This blog has a suggestion to change the code so that if you tag the post appropriately, the link will automatically appear when necessary.

UPDATE #3: In case you were wondering how to get rid of the "read more" link in the full page of your entry, the trick is to add in an additional if/then test. Here is what you should put in:
<b:if cond='data:blog.pageType == "item"'> 
<b:else/>
<b:if cond='data:post.labels'>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name == "more"'>
... <a expr:href='data:post.url'><i>click here for more</i></a>.
</b:if>
</b:loop>
</b:if>
</b:if>
Good luck!

No comments:

© 2008-2009 KWC. All rights reserved.