View Single Post
Old 07-07-2017, 04:26 AM   #11
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,488
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BetterRed View Post
@chaley - can this be done (maybe we've been here before)
  • create a User Category for Important Authors,
  • interrogate the Important Authors list in a true/false composite column template (function mode maybe ?) -- #is_important/Is Important
  • then use the value of the #is_important composite column in the icon rule.
BR
You are correct, this can work, but I make no guarantees about performance. It could be very slow, depending on how well calibre's caching works.

To fill out your example:
  1. Create a user category, which for this example we will call 'Important Authors'. This should not be a hierarchical category.
  2. Put some authors into the new user category.
  3. Make a custom column "built from other columns. Name it whatever you want. For this example I will use #important. Set "Show Checkmarks" if you want visible confirmation. Set the template to
    Code:
    {:'str_in_list(user_categories(), ',', 'Important Authors', 'Yes', 'No')'}
  4. Create a rule that checks #important for "Yes".
Note that this technique will work with any category value you put in the user category. For example, if you put a series into the category then #important will be "Yes" for all books in that series.

If you want to use a hierarchical category then two things must be true.
  1. The outermost category name (Important Authors) must be unique. It cannot be a substring of any other category or subcategory name.
  2. Use this template:
    Code:
    {:'contains(user_categories(), 'Important Authors', 'Yes', 'No')'}
chaley is offline   Reply With Quote