Greetings,
We all love 'split', so is there a way to split a template tag?
I've got a custom field called "relatedstories" defined via Preferences that takes a list of entries as input. Currently, it's just a text field and users have to do the HTML with <P>: and <:BR> tags to output them in list form, and I don't get to do anything with them. What I'd much rather do would be for users to enter a CSV or \n-delimited list and process it myself, like so
<mt:relatedstories split=",">
/* do some stuff with a related story*/
</mt:relatedstories>
Unfortunately, I don't see split or anything similar as a tag modifier anywhere in the list, and I'd really like to not have to write a module if there's a way around it. I could also add unique custom fields for each story, since there is a limit of 3, but that's kinda ugly, too. Is anybody else doing something like this, and how are you handling it?
thanks,
Bill
Reported on Movable Type 4.3
Hi Bill,
No built-in way that I know of, but I think I found a workaround: http://www.movabletips.com/2010/03/splitting-a-comma-separated-list-in-movable-type-using-template-tags.html.
Let me know if this worked for you!
Kind regards,
Maarten
Hey Maarten,
Looks brilliant! I'll definitely let you know how it works out.
Many thanks,
Bill