View Single Post
Old 01-06-2024, 06:44 PM   #1
JaymesRs
Junior Member
JaymesRs began at the beginning.
 
JaymesRs's Avatar
 
Posts: 4
Karma: 10
Join Date: Feb 2022
Device: Kobo Libra 2
I need help with writing a template program to exclude some books from being tagged

I use the page count plugin plus a template program I adapted from one found online (included below) to build a column that categorizes books by length. (I use this to build collections I use when I’m picking my next to read)

I’d like to exclude certain books from getting a classification though if they are PDFs or have tags like “Graphic Novel” or “Cookbook”. I’d appreciate any help figuring this out.

Thanks.

Code:
program:
val = field('#pagecount');
first_non_empty(
	cmp(val, 0, ' ', '', ''),
	cmp(val, 15, 'Flash Fiction', '', ''),
	cmp(val, 50, 'Short Story', '', ''),
	cmp(val, 100, 'Novelette', '', ''),
	cmp(val, 250, 'Novella', '', ''),
	cmp(val, 500, 'Short Novel', '', ''),
	cmp(val, 750, 'Long Novel', '', ''),	
	cmp(val, 1000, 'Tome', '', ''),
	'Toe Breaker');

Last edited by chaley; 01-07-2024 at 06:39 AM. Reason: Put template in code tags
JaymesRs is offline   Reply With Quote