![]() |
#1 | |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Template: avoid multiple images?
Quote:
Code:
strcat ( contains(f, "foo", 'foobar.png:', ''), contains(f, "bar", 'foobar.png:', ''), ) ![]() |
|
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,444
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Moderator Notice In general, you should make a new thread for questions about existing templates. Or use the older thread, for that matter.
Moved to separate thread Last edited by chaley; 01-15-2021 at 04:44 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,444
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: f = field('#fanficcat'); strcat ( contains(f, "Dragon Age: Origins", 'dragonageorigins.png', ''), contains(f, "Half-Life", 'halflife.png', ''), contains(f, "Mass Effect", 'masseffect.png', ''), contains(f, "The Elder Scrolls", 'theelderscrolls.png', ''), contains(f, "Pokémon", 'pokemon.png', ''), contains(f, "Portal", 'portal.png', ''), first_non_empty( contains(f, "foo", 'foobar.png:', ''), contains(f, "bar", 'foobar.png:', ''), ) ) Code:
contains(f, "^(foo|bar)$", 'foobar.png:', '') |
|
![]() |
![]() |
![]() |
#4 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
That'll work.
![]() In my case, I was adding generic media-type icons (e.g. a book or a game controller or a roll of film) to categories if I didn't have a more specific icon. It was appearing multiple times for crossovers though. In hindsight, I also think I could've made a separate rule with first_non_empty. Thank you Last edited by ownedbycats; 01-15-2021 at 05:36 PM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Possible to Do Multiple Replacements in a Save Template? | rebeltaz | Library Management | 2 | 08-27-2020 12:03 AM |
How to avoid adding borders to images and headings when importing to library | epilandrus | Conversion | 4 | 03-06-2015 10:31 AM |
help with saving template having multiple authors? | miquele | Library Management | 2 | 04-16-2013 04:49 PM |
How to avoid whits space when displaying images? | huebi | ePub | 3 | 05-16-2012 01:53 PM |
Avoid the "jagged" images in multiple e-readers | nathanp | ePub | 8 | 03-10-2012 04:08 PM |