Tuesday 24 July 2007

Hide/Show, Expand/Collapse - post element

I have been waiting for the right idea to start posting again. Thanks to The.Red.Mantissa experimenting with a favorite hack, Hide/Show, Expand/Collapse - Navigation Element, I have found the inspiration for that post. She stuck part of the expand/collapse code into the post itself. Uses? Hide a spoiler, shorten an extremely long post, add a recipe, book excerpt, or in my case, codes. Brilliant. Here is how it's done. +/-
Follow the first two steps in the instructions given in Hide/Show, Expand/Collapse - Navigation Element. Then, when writing the post, add this code to the post editing box:
<a aiotitle="click to expand" href="javascript:togglecomments('UNIQUE NAME')">+/-</a><div class="commenthidden" id="UNIQUE NAME"><p>HERE IS WHERE YOU PLACE THE HIDDEN TEXT.</div>
Added bonus! If you plan on using this hack often in your posts, simply add it to the Post Template by going to the Dashboard/ Settings/ Post Template, and put it in that box. As a matter of fact, it is easier to put it there and if you don't use it for a post, simply delete the code for that particular post.

Edit: Please note that each post must have a unique name for that post. I'm just going to start numbering mine. ie post100, post101, post102, etc.

post signature

No comments:

Post a Comment