Help - Search - Members - Calendar
Full Version: Help with Drop Down Menu
Movable Type Community Forum > Additional Resources > Tips and Tricks
kadyellebee
here's a thread that talks about using drop down boxes for archives.  I'm not exactly sure that's what you are trying to do, but the syntax of what Loa did might help you smile.gif

Kristine
nazokoneko
Whatever you put within the MTEntries container tags gets looped for each entry. Here is my code for a drop-down of monthly archives:
CODE
<script language="javascript" type="text/javascript">
function jumpPage(newLoc){
newPage  = newLoc.options[newLoc.selectedIndex].value;
if (newPage != ""){
window.location.href = newPage;
}
}
</script>

and
CODE
<form action="gotoLocation.cgi" method="get">
<select name="newLocation" onChange="jumpPage(this.form.newLocation)">
<option value="" selected>pick a month...
<MTArchiveList archive_type="Monthly">
<option value="<$MTArchiveLink$>"><$MTArchiveTitle lower_case="1"$>
</MTArchiveList>
</select>
<noscript>
<input type="submit" value="go!" class="plain">
</noscript>
</form>

This solution uses the MTArchiveList container, and you can change "Monthly" to another archive type, such as "Individual."  biggrin.gif
abbie_
Hello everyone i have a quick question,

what i am doing is using a javascript drop down menu for my old entries here is a copy of the script:

this is in the > tags:
CODE
<script language="javascript">


var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

</script>


and this is the code for the drop down menu:

CODE
<form name="Archives">
<MTEntries category="cinema" lastn="50" offset="5">
       <select name="archives"  onChange="NewWindow('<$MTEntryLink archive_type='Individual'$>#<$MTEntryID pad="1"$>','main','300','450','yes');" class="compendiummenus">
         <option value="#" selected>Previous Reviews</option>
         <option value="#">-------</option>
 <option value="<$MTEntryLink$>"><$MTEntryTitle$></option>
     </MTEntries>
       </select>
     </form>


it seems to work but what happens is that, that code creates a drop down menu for each entry.  What i really want is just one drop down menu for all the entries, and when they are selected they open up a new window with a specified height and width.

can anyone help me pleaseeeeee

thanks in advance

abbie
jenn99
I think you've got the right idea... you just need to change your code slightly... try this
CODE
<form name="Archives">
<select name="archives"  onChange="NewWindow('<$MTEntryLink archive_type='Individual'$>#<$MTEntryID pad="1"$>','main','300','450','yes');" class="compendiummenus">
<option value="#" selected>Previous Reviews</option>
        <option value="#">-------</option>
<MTEntries category="cinema" lastn="50" offset="5">
<option value="<$MTEntryLink$>"><$MTEntryTitle$></option>
</MTEntries>
      </select>
    </form>
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.