Help - Search - Members - Calendar
Full Version: category dropdown menu with a twist...
Movable Type Community Forum > Additional Resources > Tips and Tricks
ellea
would love to get some help as i'm going crazy...

i have a dropdown menu already with categories in it (just a snippet so you can see what i'm referring to):

CODE
<MTArchiveList archive_type="Category">
<option value="<$MTArchiveLink$>"><$MTArchiveTitle$> -
(<$MTArchiveCount$>)</option>


the problem i'm having is that <$MTArchiveLink$> takes me to the archive page that lists all of the entries for that category. i understand this is what the tag is meant to do, but unfortunately that's not what i want - i want it to take me to the last entry (i.e. the individual archive page) in that selected category.

i have tried looking through the template tags and couldn't find what i wanted. i have also gone crazy trying to find an answer by searching in this forum - am i complete moron (feeling like it at the moment) or is it impossible to search for more than one word in postings without the search engine thinking there's an invisible AND in there?

anyway, back to my original problem...i'm quite happy to use a php solution if it's needed, or maybe there's a plug-in for a last in category tag?

please let me know if i am making no sense in my questioning.

thank you!!!
kadyellebee
I think you could do something like this:
CODE
<MTArchiveList archive_type="Category">
<option value="<MTEntries lastn="1"><$MTEntryPermalink archive_type="Individual"$></MTEntries>"><$MTArchiveTitle$> -
(<$MTArchiveCount$>)</option>

That would still leave you with the Title from before, but set the link to the permalink of the latest entry in the category. It works because the MTEntries is nested inside of the MTArchiveList, so the MTEntries will be in context of each category as it creates the list.


When searching, I tend to try and figure out a few key words that should be in the results like "category AND dropdown" -- putting the AND in there ensures that both words will be in the results.

Kristine
ellea
thank you very much! i will give it a try this morning after i've had some coffee and let you know if i get the result i'm after.

re searching: i had tried putting the AND in there, and from what i could tell (but maybe i was wrong and need to try again), it turned those two words into a phrase rather than searching for all postings with those two words not necessarily right next to each other...for instance, doing a search for mt AND php gave me all results with "mt php".

hmmmm. anyway, coffee is ready, so i will post again in a bit.

thanks again - your help is greatly appreciated!
ellea
your solution worked perfectly. i couldn't thank you enough.

thank you thank you thank you!
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.