I have a pretty big site (750+ pages) with an index page that displays a complete site listing with Ditto and I’ve run into a bit of a human error snag that I’d like to be able to account for:
I’m using the [+longtitle+] placeholder to display the title for each list item, but if my team members make a new page and forget to fill in the Longtitle field, the [+longtitle+] placeholder for that item will (of course) be blank. Yeah, yeah, human error and all.
Since I can’t hover over my team all day and make sure they fill out every field, what I really need is a little bit of a failsafe against that: is there any way to set up a placeholder that will look for, say, the longtitle, but if longtitle is empty, it will try pagetitle, and so on.
That way, I’ve got a better chance of showing at least
a title if longtitle is blank.
The Breadcrumbs snippet does something like this with its prioritized linkTextField parameter (defaults to ’menutitle,pagetitle,longtitle’ but will only display the first nonempty one).
Is there any way to do this with Ditto? I’m open to any possibilities.
For what it’s worth, here’s my current ditto template. Nothing fancy:
<li><a href="[~[+id+]~]" title="[+description+]">[+longtitle+]</a></li>
And the ditto call. Again, nothing fancy:
[!Ditto? &parents=`1` &depth=`7` &display=`all` &tpl=`simple_li`!]