Quote:
Originally Posted by davidfor
Yes, the check box says to use the template as well as the columns. The template result should be a comma separated list of collections names. That way, a template of "{#some_column}" is the same as just using "#some_column" as the collections column.
|
It can't be a comma separated list because that would break authors, other "is_names" custom columns, or single-valued columns where the value contains a comma. That is why my example code uses ':@:'.
I have most of the implementation to permit overriding metadata management with a template. See the screen capture. If you wish I can forward it when the implementation is finished.
FWIW: I have added a new formatter function that I have wanted for some time, list_join(). It simplified dealing with generating the item list. Here are the details.
Quote:
Code:
list_join(with_separator, list1, separator1 [, list2, separator2]*)
Returns a list made by joining the items in the source lists (list1 etc) using with_separator between the items in the result list. Items in each source list[123...] are separated by the associated separator[123...]. A list can contain zero values. It can be a field like publisher that is single-valued, effectively a one-item list. Duplicates are removed using a case-insensitive comparison. Items are returned in the order they appear in the source lists. If items on lists differ only in letter case then the last is used. All separators can be more than one character.
Example:
Code:
program:
list_join(':@:', $authors, '&', $tags, ',')
You can use list_join on the results of previous calls to list_join as follows:
Code:
program:
a = list_join(':@:', $authors, '&', $tags, ',');
b = list_join(':@:', a, ':@:', $#genre, ',', $#people, '&', 'some value', ',')
You can use expressions to generate a list. For example, assume you want items for authors and #genre, but with the genre changed to the word "Genre: " followed by the first letter of the genre, i.e. the genre "Fiction" becomes "Genre: F". The following will do that:
Code:
program:
list_join(':@:', $authors, '&', list_re($#genre, ',', '^(.).*$', 'Genre: \1'), ',')
|