Quote:
Originally Posted by ownedbycats
two questions:
a) Why does list_union seem to work in reverse? (e.g. if I put 'omnibus' first in template, it appears at the end of the list).
|
list_union and several other list operations don't guarantee order.
Quote:
b) Currently, an icon rule checks #admin_tags for 'omnibus.' Would there be any performance impact by checking the composite column instead?
|
The composite will be slower, possibly much slower. The template must be evaluated for every book being displayed. If it is evaluated in any event, for example to display the computed list, then the performance penalty is much reduced.
FWIW: Since you want Omnibus at the head of the list, I would write the template like this.
Code:
program:
## Splitting tags
if
'^(Fiction|Nonfiction|Magazines & Periodicals)' in $#booktyoe
then
split_tags = re($tags, '\.', ',')
else
split_tags = ''
fi;
## Removing a few unwanteds and sorting
cleaned_tags = list_sort(list_difference(
split_tags,
'Fiction, Nonfiction, Magazines & Periodicals, Cultures & Regions, Social Issues',
','), 0, ',');
## Last runthrough - Checking for omnibus
if
'omnibus'
in
$tags
then
cleaned_tags = 'Omnibus' & if cleaned_tags then ', ' & cleaned_tags fi
fi;
cleaned_tags
Quote:
Thanks and merry christmas (or whatever you celebrate)
|
Thank you. I hope the same (now past tense) for you.