Friday, December 29, 2006
I've spent quite a while (and am taking a short break from) labelling all my posts in the new Blogger. However, I use my own template (classic blogger style) and can't make use of the widgets that new blogs can in layout mode.
As it is, someone can click on one of the labels at the bottom of a post and see all other related posts, but what if someone wanted to see a list of them?
A bit of lateral thinking later and here's your answer (many thanks to JavaScript Kit for their dropdown menu code):
<form name="labellist">
<select name="labels" onchange="go()">
<option value="path/to/your/blog/labels/here">label name</option>
etc...
</select>
<script type="text/javascript">
<!-- function go(){
location=
document.labellist.labels.
options[document.labellist.labels.selectedIndex].value
}
//-->
</script>
<input name="labelgo" value="Go" onclick="go()" type="button">
</form>
<noscript>
<p>
<a href="/blog/labels/adsense.htm">label name</a><br /> etc...
</p>
</noscript>
Just paste this code into your template where you want the labels to go. You do need to know a few things first though - where your labels are kept (should be a subfolder of your blog folder), and the names of all your labels so you can list them.
This method works whether your blog visitor has javascript enabled or not - if they do, they'll see the dropdown box and select from there. If javascript has been disabled, they'll see a list of all your labels.
Labels: blogging, programming