![]() |
#1 |
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 7891011
Join Date: Sep 2020
Device: none
|
Convert GPM to PTM - Emblem Rule
Hi!
I have some emblem rules like these, for the cover grid: Code:
program: test($#last_viewed, 'lastop-dark.png', ''); Code:
program: test(contains(field('formats'), "EPUB", '1', ''), 'logo epub.png', ''); |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,440
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Possible? certainly.
Advisable? depends.
As for the templates themselves ... Code:
program: test($#last_viewed, 'lastop-dark.png', ''); Code:
python: def evaluate(book, context): date = book.get('#mydate') return 'lastop-dark.png' if date is not None else '' Code:
program: test(contains(field('formats'), "EPUB", '1', ''), 'logo epub.png', ''); Code:
python: def evaluate(book, context): formats = book.get('formats') return 'logo epub.png' if formats is not None and 'EPUB' in formats else '' |
![]() |
![]() |
Advert | |
|
![]() |
#3 | ||
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 7891011
Join Date: Sep 2020
Device: none
|
Quote:
Quote:
![]() I've attached the icons I'm using for emblems, maybe someone finds them useful. |
||
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Running PTM/PythonTemplateContexts in Job, not GUI | DaltonST | Library Management | 3 | 12-26-2022 08:30 AM |
Math functions in GPM | sweth | Library Management | 4 | 05-31-2021 07:05 PM |
Custom column GPM | foobarius | Library Management | 3 | 09-04-2016 07:20 PM |
Emblem overlay in Covergrid? | rlugojr | Calibre | 7 | 08-09-2014 03:48 AM |
The Demon Emblem | TheDemonEmblem | Self-Promotions by Authors and Publishers | 1 | 07-11-2014 09:01 PM |