10-10-2022, 11:01 AM | #421 | |
Custom User Title
Posts: 8,841
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
And yes, just go to the next tag. Hopefully the code works. Last edited by ownedbycats; 10-10-2022 at 11:33 AM. |
|
10-30-2022, 04:30 PM | #422 |
Custom User Title
Posts: 8,841
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
For a template search, is there a way to search for 'template returns any value'?
e.g. the first search I did via a GPM if-then returning 'yes' but there might be a better way. |
Advert | |
|
10-30-2022, 04:46 PM | #423 | |
Grand Sorcerer
Posts: 11,789
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
EDIT: like this (screen capture) Last edited by chaley; 10-30-2022 at 04:52 PM. Reason: Added screen capture |
|
10-30-2022, 06:07 PM | #424 |
Custom User Title
Posts: 8,841
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
That works! I should check tooltips more often.
|
11-23-2022, 04:21 AM | #425 |
Custom User Title
Posts: 8,841
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Code:
program: round(days_between($#filedate, $date)) EDIT: Also, is there a better way to search that both columns have the same calendar date? MCS failed. Last edited by ownedbycats; 11-23-2022 at 05:00 AM. |
Advert | |
|
11-23-2022, 02:28 PM | #426 | ||
Grand Sorcerer
Posts: 11,789
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
|
||
11-23-2022, 04:57 PM | #427 |
null operator (he/him)
Posts: 20,681
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
MM is Month because it's bigger than a minute.
BR |
11-23-2022, 05:28 PM | #428 |
Grand Sorcerer
Posts: 11,789
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
11-23-2022, 07:22 PM | #429 |
Custom User Title
Posts: 8,841
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
That works. I also could've added #filedate:true to the search.
|
11-24-2022, 09:27 PM | #430 |
Custom User Title
Posts: 8,841
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Code:
program: ## Splitting tags if '^(Fiction|Nonfiction)' in $#booktype then split_tags = re($tags, '\.', ',') fi; ## Removing a few unwanteds cleaned_tags = list_difference( split_tags, 'Fiction, Nonfiction, Cultures & Regions, Social Issues', ','); 1. Retrieve tags when the booktype is Fiction|Nonfiction. 2. Replace the '.' with a ',' to turn hierarchical tags into a list. 3. Remove a few unwanted entries from the list. It works... mostly. If booktype is not Fiction|Nonfiction, it returns EXCEPTION: Interpreter: Unknown identifier 'split_tags' - line number 12. What should I do? EDIT: I found that also adding a second if-then check for Fiction|Nonfiction before cleaning the tags works. Last edited by ownedbycats; 11-25-2022 at 06:50 AM. |
11-25-2022, 09:38 PM | #431 |
Custom User Title
Posts: 8,841
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question: Is it possible to reference a grouped search in a template?
|
11-26-2022, 02:43 AM | #432 |
Grand Sorcerer
Posts: 11,789
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
11-27-2022, 12:42 AM | #433 |
Custom User Title
Posts: 8,841
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Something like if 'value' in groupsearch (or inlist?) where groupsearch was a few related columns.
I suppose for this case it might make more sense to just combine them together in the template itself with a list_join or something. |
11-27-2022, 02:25 AM | #434 |
Custom User Title
Posts: 8,841
Karma: 62032373
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
A different question:
I have this for a column. Code:
program: first_non_empty( if 'Cleanup' in virtual_libraries() then 'polish.png' fi, if 'Fanfiction' in $#booktype then icons_fanfic() fi, if 'Documentations & Manuals' in $#booktype then 'helpbook.png' fi, if 'Loans' in virtual_libraries() then 'overdrive.png' fi, if 'Physical Books' in virtual_libraries() then 'paperbook.png' fi, 'view.png', ) Code:
program: f = $#fanficcat; strcat( if "^Fallout$" inlist f then 'fallout.png:' fi, if "^Half-Life$" inlist f then 'halflife.png:' fi, if "^(Mass Effect Trilogy|Mass Effect: Andromeda)$" inlist f then 'masseffect.png:' fi, if "^The Elder Scrolls$" inlist f then 'theelderscrolls.png:' fi, if "^Pokémon$" inlist f then 'pokemon.png:' fi, if "^Portal$" inlist f then 'portal.png:' fi, ) If it's possible, it seems the easiest way to do this would be to truncate at the first colon so the output is, e.g. fallout.png instead of fallout.png:halflife.png:. Is this doable? EDIT: list_split is what i was looking for! Code:
if 'Fanfiction' in $#booktype then list_split(icons_fanfic(), ':', 'ff'); ff_0 fi, Last edited by ownedbycats; 11-27-2022 at 03:46 AM. Reason: fixing indenting |
11-27-2022, 12:31 PM | #435 | |
Grand Sorcerer
Posts: 11,789
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
To do what I think you want you need to invoke the search. For example, if you want to know if a gst will match the current book then something like this: Code:
program: globals(ids = ''); if ! ids then ids = book_values('id', '@gst:true', ',', 0); set_globals(ids) fi; $id in ids |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Library Management: various questions not worth their own thread | ownedbycats | Library Management | 153 | 05-14-2024 01:30 AM |
[Metadata Source Plugin] Questions regarding parse select, docs and ref templates | Boilerplate4U | Development | 13 | 07-07-2020 02:35 AM |
Questions on Kobo [Interfered with another thread topic] | spdavies | Kobo Reader | 8 | 10-12-2014 11:37 AM |
[OLD Thread] Some questions before buying the fire. | darthreader13 | Kindle Fire | 7 | 05-10-2013 09:19 PM |
Thread management questions | meme | Feedback | 6 | 01-31-2011 05:07 PM |