Wednesday, August 25, 2004
So you want to show/hide a post in Blogger (or any other blog) but don't like the two options (1, 2) offered to you in their Hacks section? Fear not, there is a solution. This gets a little technical, so read on if you care...
[+/-] Read more...

Basically, there are four steps to the process

1) Download and save somewhere on your server the javascript that I found in a great article from pootato.org. To do that, right-click on the link that's at the top of the article. You could use the script in situ, but I prefer to save a local copy on my web server, for safety reasons (that way nobody can go back into the script and put malicious code in it).

2) In your template, add the following line in the {head} section (replace the { and } characters by <>):

{script type="text/javascript" src="the path to your saved copy of the script"}{/script}

3) In the post where you want to add the Show/Hide thingie, add the following HTML code (obviously in Edit HTML mode, and where XXX is a number unique for each post using this functionality):

{H5 style="cursor:hand" onClick="expandcontent('XXX')"}{U}[+/-] Read more...{/U}{/H5}{div id="XXX" class="poo"}
bla bla
{/div}

4) Go back into regular Compose mode and replace the "bla bla" with whatever text you want to show/hide (be careful with the edits, as the Compose mode is sometimes capricious; the best way to do it is to put your cursor between the two bla words, add your post, and then delete the bla words).


Tech