Comment 1 for bug 821935

Revision history for this message
Charles Haley (cbhaley) wrote :

Can't do it the way you ask. The individual template items are evaluated separately, then combined together. At that point the priority information, which would need to be in the form of a function, would be lost.

I have added a new template function, strcat_max, that does what you want in a different way. The documentation for the new function is:
strcat_max(max, string1, prefix2, string2, ...)`` -- Returns a string formed by concatenating the arguments. The returned value is initialized to string1. `Prefix, string` pairs are added to the end of the value as long as the resulting string length is less than `max`. String1 is returned even if string1 is longer than max. You can pass as many `prefix, string` pairs as you wish

You would use something like:
{:'strcat_max(100, field('title'), ' - ', field('author'), ',', field('pubdate'))'}

You might want to 'shorten' the first argument(title).