|  09-20-2020, 08:03 PM | #886 | 
| Custom User Title            Posts: 11,351 Karma: 79528341 Join Date: Oct 2018 Location: Canada Device: Kobo Libra H2O, formerly Aura HD | 
			
			I have a date column, #fanficupdated. Is it possible for a template rule to compare that to the date of a matched book currently on the device and return a bool?  I'd like to display a column icon if the version of a fanfic in my library is newer than the one on the device (to remind me to re-upload it). Making a hidden composite column to tie the icon to seems best idea. Last edited by ownedbycats; 09-23-2020 at 08:05 PM. | 
|   |   | 
|  10-13-2020, 07:15 PM | #887 | 
| Custom User Title            Posts: 11,351 Karma: 79528341 Join Date: Oct 2018 Location: Canada Device: Kobo Libra H2O, formerly Aura HD | 
			
			For a format_date, how would I make it return the first three numbers of the year?   Code: {pubdate:'test($,
strcat(format_date($,'yyyy')),
'Unknown')'} | 
|   |   | 
|  10-13-2020, 07:39 PM | #888 | |
| Grand Sorcerer            Posts: 12,525 Karma: 8065948 Join Date: Jan 2010 Location: Notts, England Device: Kobo Libra 2 | Quote: 
 It seems that adding substr to the template functions might be a good idea. | |
|   |   | 
|  10-29-2020, 07:54 PM | #889 | 
| Custom User Title            Posts: 11,351 Karma: 79528341 Join Date: Oct 2018 Location: Canada Device: Kobo Libra H2O, formerly Aura HD | 
			
			Is there a template function that can test for "does this book have an annotation/bookmark"?
		 | 
|   |   | 
|  10-30-2020, 03:33 AM | #890 | 
| Grand Sorcerer            Posts: 12,525 Karma: 8065948 Join Date: Jan 2010 Location: Notts, England Device: Kobo Libra 2 | |
|   |   | 
|  10-30-2020, 04:14 AM | #891 | 
| Custom User Title            Posts: 11,351 Karma: 79528341 Join Date: Oct 2018 Location: Canada Device: Kobo Libra H2O, formerly Aura HD | 
			
			Thank you.   For context, I was hoping to make a psuedobool composite column. Last edited by ownedbycats; 10-30-2020 at 04:19 AM. | 
|   |   | 
|  10-30-2020, 05:14 PM | #892 | |
| Grand Sorcerer            Posts: 12,525 Karma: 8065948 Join Date: Jan 2010 Location: Notts, England Device: Kobo Libra 2 | Quote: 
 | |
|   |   | 
|  10-30-2020, 05:16 PM | #893 | 
| Custom User Title            Posts: 11,351 Karma: 79528341 Join Date: Oct 2018 Location: Canada Device: Kobo Libra H2O, formerly Aura HD | 
			
			Understandable. I might make an enhancement request for some option to mark all the books with annotations.
		 | 
|   |   | 
|  10-31-2020, 10:44 AM | #894 | ||
| Grand Sorcerer            Posts: 12,525 Karma: 8065948 Join Date: Jan 2010 Location: Notts, England Device: Kobo Libra 2 | Quote: 
 Quote: 
 I also added a template function annotation_count() that returns the count if it is > 0 else the empty string. This will work with template functions like "isempty()", "test()", "first_non_empty", etc. It will also work with numeric relationals such as "if annotation_count() ># 0 then 'foo' else 'bar' fi" | ||
|   |   | 
|  10-31-2020, 02:20 PM | #895 | 
| Custom User Title            Posts: 11,351 Karma: 79528341 Join Date: Oct 2018 Location: Canada Device: Kobo Libra H2O, formerly Aura HD | 
			
			Thank you    | 
|   |   | 
|  11-05-2020, 01:04 PM | #896 | 
| Custom User Title            Posts: 11,351 Karma: 79528341 Join Date: Oct 2018 Location: Canada Device: Kobo Libra H2O, formerly Aura HD | Code: program: p = identifier_in_field(id:isbn) g = identifier_in_field(id:goodreads) if p then strcat(p) else if g then strcat(g) fi I'm still trying to figure these out.   | 
|   |   | 
|  11-05-2020, 02:12 PM | #897 | |
| Grand Sorcerer            Posts: 6,686 Karma: 12595249 Join Date: Jun 2009 Location: Madrid, Spain Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2 | Quote: 
 Code: program:
	p = identifier_in_field(id:isbn)
	g = identifier_in_field(id:goodreads)
        if p then strcat(p)
        else 
           if g then strcat(g)
           fi
        fi | |
|   |   | 
|  11-05-2020, 02:16 PM | #898 | |
| Grand Sorcerer            Posts: 12,525 Karma: 8065948 Join Date: Jan 2010 Location: Notts, England Device: Kobo Libra 2 | Quote: 
 
 Code: program:
	i = field('identifiers');
	ifempty(select(i, 'isbn'), select(i, 'goodreads'))Code: program:
	i = field('identifiers');
	p = select(i, 'isbn');
	if p then p else select(i, 'goodreads') fi | |
|   |   | 
|  11-05-2020, 07:18 PM | #899 | 
| Custom User Title            Posts: 11,351 Karma: 79528341 Join Date: Oct 2018 Location: Canada Device: Kobo Libra H2O, formerly Aura HD | 
			
			That works.   I was just starting out with the two identifiers as a a test case. Eventually I want to encompass more identifiers in descending priority (e.g. if isbn or goodreads doesn't exist, check asin, then google, then url, etc...). | 
|   |   | 
|  11-06-2020, 06:14 AM | #900 | |
| Grand Sorcerer            Posts: 12,525 Karma: 8065948 Join Date: Jan 2010 Location: Notts, England Device: Kobo Libra 2 | Quote: 
 Code: program:
	i = field('identifiers');
	first_non_empty(
		select(i, 'isbn'),
		select(i, 'goodreads')
# more as desired
	) | |
|   |   | 
|  | 
| Tags | 
| custom column, tag, tags | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Should composite columns appear in Grouped Searches? | ownedbycats | Library Management | 3 | 02-13-2021 03:43 PM | 
| Having problems with composite columns and save/send templates | Trel | Calibre | 4 | 09-26-2016 03:21 PM | 
| Tooltips for narrow columns | theducks | Library Management | 7 | 03-16-2015 10:58 PM | 
| Techniques to use plugboards, custom columns and templates | kovidgoyal | Library Management | 0 | 01-26-2011 04:21 PM |