Help - Search - Members - Calendar
Full Version: Pull Down Menu
Movable Type Community Forum > Using Movable Type > Entries and Archives
errecielle2
Hi
I'm upgrading to MT 4.12. In the 3.xx I having a piece of code help me to have a pull down menu instead a list of categories, entries and archives.
Right now this code is not working anymore.

Could someone help me on this point?

I was not able to find a solution in the forum

Thanks

r.
OtherNiceMan
Where did you get the code from?

Can you post the code you are using?

Do you have a link to what the code is producing?
errecielle2
here you can find the instructions I using on 3.xx

There is also this but is not working on the widget using MT 4.12

Do you have any idea? Any link to some widget solving this problem?

r.
OtherNiceMan
Do you have a published page with this on so I can see what html is being produced.
errecielle2
No more because I've republished all my blog
OtherNiceMan
It works for me, with a small change, here is what I did.

In the admin panel Design>Templates>Widgets

I created a new widget called CatDD with the followin code.

CODE
<mt:IfArchiveTypeEnabled archive_type="Category">
<div class="widget-archive widget-archive-category widget">
    <h3 class="widget-header">Categories</h3>
    <div class="widget-content">
<form action="" name="pulldown1">
<select name="mypulldown1"
onchange="document.location=pulldown1.mypulldown1.options[selectedIndex].value">
<option value="">Select Category</option>
<MTArchiveList archive_type="Category">
<option value="<$MTArchiveLink$>"><$MTArchiveTitle$></option>
</MTArchiveList>
</select>
</form>
</div>
</mt:IfArchiveTypeEnabled>


I then edited the sidebar template to include the widget

CODE
<$MTInclude widget="CatDD"$>
errecielle2
Wonderful: it works! (only in the secondary column, because in the primary column it change the the secondary column layout)

And what about entries, comments and montly archives? wink.gif

I've tried to modify this widget but ... I'm not able sad.gif
OtherNiceMan
For monthly you just need to change the archive_type, acceptable types can be found here http://www.movabletype.org/documentation/a...rchivetype.html

CODE
<MTArchiveList archive_type="Monthly">
<option value="<$MTArchiveLink$>"><$MTArchiveTitle$></option>
</MTArchiveList>


Comments and entries need a little more work
CODE
<comments>
<option value="<$MTCommentLink$>"><$CommentBody words="15" convert_breaks="1"$></option>
</comments>


the words attribute should limit you to the first 15 words of the comment, you do not really need the whole comment in the drop down. Convert breaks removed line breaks that could cause a problem as well. You might want to limit comments see http://www.movabletype.org/documentation/a...s/comments.html

Entries are similar to comments,

CODE
<entries>
<option value="<$mt:EntryPermalink$>"><$mt:EntryTitle$></option>
</entries>


again, if you want to limit your entries see http://www.movabletype.org/documentation/a...gs/entries.html
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-2008 Invision Power Services, Inc.