Templates

How do I create a drop down menu for my archives?

Scenario:
"I have a lot of blog entries and my archive list is getting very long. I want to create a valid XHTML drop down menu for my archives."

Solution:
Use the onchange attribute in your list, which is defined in your template.

Original forum thread (thanks, moraes!):
http://forum.nucleuscms.org/viewtopic.php?p=19698#19698

Method:
Use the following code in your template.

Archive List Header

<form>
<select name="archives" onchange="window.location.href=this.form.archives.options[this.form.archives.selectedIndex].value">
<option value="">Archives</option>

Archive List Item

<option value="<%archivelink%>">%B, %Y</option>

Archive List Footer

<option value="./archives/<%blogid%>">All</option>
</select></form>
section: Templates | submitted by Leng on 2005.May.07 | 4667 views

item rate
Total votes: 8 - Rating: 4.88

Please tell us how useful this answer was to you (0 = useless, 10 = very very helpful):

10