Quote:
Originally Posted by Mister L
Glad I decided to ask for help.
Thank you! I think the Collections template could be perfect, if I can use it on top of the other collections columns I already use?
|
Yes, you can use template-based collections with column-based collections.
Quote:
If it's easiest, I could use the publisher name for the collection and change the books I have marked manually, but I would like to keep the collections I already was using if I can.
One publisher name is "BEL Editions" and the collection name is "BEL", and another one is "Bibebook" and the collection is "dp". Would the template look like this?
Code:
program:
str_in_list('BEL Editions, Bibebook', ',', $BEL, $dp, '')
Or do I need to make one rule per collection?
Code:
program:
str_in_list('BEL Editions', ',', $BEL, '')
str_in_list('Bibebook', ',', $dp, '')
|
You need a "rule" per publisher. For me, the clearest and easiest way is this:
Code:
program:
switch_if(
$publisher == 'BEL Editions', 'BEL',
$publisher == 'Bibebook', 'dp',
$publisher == 'Baen', 'Baen',
$publisher == 'Tom Doherty Associates', 'TOR',
'')
Notes:
- You can have as many "rules" as you want.
- The equals comparison is case insensitive.
- The '' at the end is the default if no comparison matches. You might want to use an actual value there.
- Having a collection name appear twice, for example in both a column and in the template result, isn't a problem.