Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 03-06-2020, 01:50 AM   #1
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
Reusing a custom column saved other columns as advanced icon-rule

Hi.

Is it possible to re-write this:

Code:
program:
words=raw_field('#words');
shelf_name=cmp(words, 50, 'Art', 'Drabble', 'Drabble');
shelf_name=cmp(words, 500, shelf_name, 'Ficlet', 'Ficlet');
shelf_name=cmp(words, 5000, shelf_name, 'Novel', 'Novel');
shelf_name=cmp(words, 50000, shelf_name, 'Long', 'Long');
shelf_name=cmp(words, 100000, shelf_name, 'Epic', 'Epic');
to use as an advanced icon-rule?
Tanjamuse is offline   Reply With Quote
Old 03-06-2020, 06:08 AM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
You can:

Create a rule for each value the column produces that sets the icon.

Use an advanced rule that that builds the icon name from the value the column returns. If you have icons of the same name as the values (eg. "Figlet.png"), this would be something like (untested as I don't have the column):

Code:
{:'strcat(field("book_size"), ".png")'}
Create an advanced rule using a copy of the code and change the results it produces to the icon name wanted. That would be changing "Ficlet", "Drabble" and the rest to the name of the icon.
davidfor is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help w/Advanced Column Icon Rule BookJunkieLI Library Management 4 07-11-2018 02:00 PM
Advanced Icon Rule with Exception Tanjamuse Library Management 21 05-01-2018 01:26 AM
Advanced Custom Icon with two requirements One4Tanner Library Management 3 03-11-2015 02:14 AM
Custom Column Build from other Columns Tanjamuse Library Management 7 10-16-2014 01:28 AM
Custom Column Icon Help alanHd Library Management 2 02-04-2013 03:30 AM


All times are GMT -4. The time now is 08:18 PM.


MobileRead.com is a privately owned, operated and funded community.