Quote:
Originally Posted by gers1978
3) Set the Template field to "{series:|({author}) |}"
|
Using template items inside template items can lead to very strange results. The fact that it works at all is a bug that I haven't fixed because it can be useful in the right context. The problem is that the value of the subitem will be rescanned in the context of the containing item as if it had been hand-typed there. Special characters such as | and {} and : inside the subitem will greatly confuse the scanning of the containing item.
If you can guarantee that the subitem ({authors} in this case) will never contain any of the characters { } | and possibly " and ', then there is no problem.
The following template avoids this problem by using template program mode instead of a sub-item.
Code:
{series:'test($, strcat('(', field('authors'), ') ', $), '')'}
If series has a value, then return the desired string built by concatenating together the parts, otherwise return the empty string.