Help - Search - Members - Calendar
Full Version: How do I  make a drop down menu for my entries
Movable Type Community Forum > Additional Resources > Tips and Tricks
loa
CODE
<option value="<$MTArchiveLink$>"><$MTArchiveTitle$></option>
   </MTArchiveList>

the code for the entries are the same.
girlie
Very nifty! Would you share the code portion for the Entries and Category drop-downs as well??
chris24net
What would you need to do to the monthly archive dropdown script to get it to work on non-blog pages as well?  I have other pages on my site, but I'd still like to have the archive dropdown on them so people can go to the archives from those pages also.  Thanks.
kadyellebee
A bit of clairification smile.gif
To do what YellowX is talking about, you need to create your drop down box in an index template within MT so it processes the MT tags before publishing to an .shtml or .php file.  Then it can be included anywhere using SSI as described or PHP with .php extentions using this format:
CODE
<?php include("/home/USERNAME/public_html/dropdown.html"); ?>


smile.gif

Kristine
loa
/I am getting confused/ How do I set the option value so that when ever I add a new entry it appears in the drop down menu box?

CODE
<select onChange="document.location=options[selectedIndex].value;" style="font-family:'Verdana';color:003366;background-color:#FFFFFF;text-decoration:none;font-size:8pt; width=140">
<option value="">Recent Entries...</option>
loa
Pete Bevin's . com
loa
CODE
<form>
<select onChange="document.location=options[selectedIndex].value;" style="font-family:'Verdana';color:003366;background-color:#FFFFFF;text-decoration:none;font-size:8pt; width=140">
<option value="">Monthly Archives...</option>
<MTArchiveList archive_type="Monthly">
<option value="<$MTArchiveLink$>"><$MTArchiveTitle$></option>
</MTArchiveList>
</select>

<select onChange="document.location=options[selectedIndex].value;" style="font-family:'Verdana';color:003366;background-color:#FFFFFF;text-decoration:none;font-size:8pt; width=140">
<option value="">Categories...</option>
<MTArchiveList archive_type="Category">
<option value="<$MTArchiveLink$>"><$MTArchiveTitle$></option>
</MTArchiveList>
</select>

<select onChange="document.location=options[selectedIndex].value;" style="font-family:'Verdana';color:003366;background-color:#FFFFFF;text-decoration:none;font-size:8pt; width=140">
<option value="">Recent Entries...</option>
<MTEntries lastn="20">
<option value="<$MTEntryLink$>"><$MTEntryTitle$></option>
</MTEntries>
</select>
</form>

Sorry for the delay, there is one problem I am having with this though if I make the  title to long it screws up the table on the page.
yellowX
You could probably just create a separate SSI file (server side include) with just the code for the drop down and then call that file within your other pages using:

CODE
<!--#include virtual="/path/to/MT/dropdown.file" -->


But make sure that your pages are saved as .shtml instead of .html so your server knows to parse them for server side includes. For more info on SSI, check out Apache's documentation.
yellowX
Hehe, thank you - I'm afraid I'm in a bit of a vague mood tonight smile.gif
Babs
Would it be possible to have more than one drop down list per archive category?

Say I want to have my 2001 monthly archives in one drop down list and my 2002 monthtly archives in a different list.

is there a variable that could be added to
CODE
<MTArchiveList archive_type="Category">
that would make this possible?
idburns
QUOTE

I used that, thanks for the link.  See my results here.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.