Help - Search - Members - Calendar
Full Version: post title excerpt
Movable Type Community Forum > Additional Resources > Tips and Tricks
taison
Is it possible for movable type to automatically generate a title for the post by taking the first 20 letters of the entry?

I would like this to happen whenever I decide to not put a title for my entry.

Thanks in advance for anyone's assistance.
kadyellebee
If you just are worried about the outputted text getting a title, yes, that is do-able; but if you actually want to save a title in the database when there isn't one there, that might be a bit harder.

The IfEmpty plugin would probably do this best...
CODE
<MTIfEmpty var="EntryTitle"><$MTEntryBody trim_to="20"$></MTIfEmpty>
<$MTEntryTitle$>

So that will give you 20 characters of the Body if your title is empty; and then print the title if its not empty.

Hope that helps,
Kristine
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.