Movable Type: is there a plugin/hack that would make it easy to insert a different line of code depending on a selection from a pull-down menu?
What I'd like to do is replicate an old format on my blog posts seen in earlier posts
here.
For all those posts, I was simply inserting the IMG tags in the actual title line of the post. That's obviously both cumbersome and bad coding.
What I'd like to do is have some kind of option in my edit window where I can select an item from a dropdown menu, or write in a keyword or something, and then the corresponding icon graphic appears in the post. As the page I linked to shows, I'd prefer it to be able to have "no icon" as an option, as well as possibly different sizes. (The former is a much bigger deal though)
The closest I came was CustomFields, but it didn't seem to be doable as it's not complex enough to correspond image tags to a selection field.
I guess the best comparison would be those weird "current mood" things on LiveJournal, etc. Except instead of selecting the mood and having it display the mood I'm in, a corresponding picture would be there.
I have this nagging suspicious this is a simple thing to do and the answer is right under my nose but I've tried unsuccessfully for a month now to come up with an idea.
x1x2
popcorn
whatever
somethingelse
etcetera
Then in your MT template code, you'd simply use something like:
<MTIfExtraField field="icon">
<div class="floating-icon">
<img src="/myimages/<$MTExtraFieldValue field="icon"$>.gif" />
</div>
</MTIfExtraField>
That would take care of the "no icon" issue as well151;you simply wouldn't select an icon.
You can do this with CustomFields, too, but I'm not sure of the syntax offhand.
If you do want to use RightFields for this and have questions about template code details, my plugin forums are at your disposal.
posted by staggernation at 4:54 PM on February 8, 2007