Help - Search - Members - Calendar
Full Version: Generating file names for untitled entries
Movable Type Community Forum > Additional Resources > Tips and Tricks
celina
This might not be in the right place but here goes:

I am maintaining an installation of Movabletype for a friend of mine. I've noticed she occasionally makes entries without entering a title. I've gone in and installed MTIfEmpty so those entries show up with Untitled on the main page but now I've noticed the problem with the Individual Entry Archive files that having no title produces. Instead of using MTIfEmpty, is there another way that would automatically title the entries "untitled"?

I have the individual archives set as: <$MTArchiveDate format="%Y/%m/%d"$>/<$MTEntryTitle dirify="1"$>.html which produces archive files in 2004/08/16/entrysubject.html however, with no title entered, the path turns into 2004/08/16/.html which then produces an error.

My friend uses this installation of Movabletype as a daily diary so her posting more than one entry a day is rare. Would it be too difficult to tell MT to make untitled entries publish with untitled as the title? (so it produces untitled.html files) Or could anybody suggest any other way of doing this? (other than yelling at her and telling her to make titles on her entries wink.gif )

Thank you for your help!
warnadunia
Hello there...

I hope it helps.

Since there is (sometimes) no entry title, so, we need something unique owned by the entry used as the permalink, right?

I tried a little bit about your case. Here, I use MTIfEmpty plugin. In the individual archives file, I have this: (based on your archiving structure)

CODE
<$MTArchiveDate format="%Y/%m/%d"$>/<MTIfEmpty var="EntryTitle"><$MTEntryID$>.html</MTIfEmpty><MTIfNotEmpty var="EntryTitle"><$MTEntryTitle dirify="1"$>.html</MTIfNotEmpty>


So, IF there is no title, the permalink will use the EntryID. Or, if you want something else like keyword, I am sure you can too.

I hope it answers your problem. Thanks!
celina
It didn't even occur to me to use MTIfEmpty within the individual archives code.

Thank you so much!
manky
my issue here is that I have titles... however they are the same... (ex: movies watched... watching the same one more than once in a month) and for new entries everythings works fine (see Cupid & Cate @ http://amancay.com/flix/archives/2004/09/index.php) but for the older, pre-existing entries it's not being smart (see Bruce Almighty @ http://amancay.com/flix/archives/2003/11/index.php)
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.