View Single Post
Old 09-29-2015, 11:05 AM   #579
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,025
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by Mieeka View Post
Any idea's how i can do this?
There isn't any mechanism built in to custom_columns_settings to conditionally set columns based on value.

However, you can use replace_metadata, which does have conditional capabilities to create a value that can be set in custom_columns_settings. It is a tad complex.

Code:
[defaults]
## Add an additional valid metadata entry to use.  Name 'priority' isn't 
## special.
## Use 'add_to_' because many sites have their own extra_valid_entries.
add_to_extra_valid_entries:,priority

## Copy title to priority.  Could be any metadata that's always 
## present--except status because we're using that for the conditional 
## below.
include_in_priority:title

## Use 'add_to_' in case of site specific replace_metadata.
add_to_replace_metadata:
## Replace priority value with empty string. 
 priority=>.*=>
## OTOH, if status is Completed, set 'priority' to 'Finished'
## '.*' also matches empty string
 priority=>.*=>Finished&&status=>Completed

custom_columns_settings:
## "Med" for new only
 "Med"=>#ccolumn,n
## replace with 'priority' value.  But it only happens if 'priority' is set to
## non-empty string. IE, only when status=Completed
 priority=>#ccolumn,r
This would be a bit less completed if there weren't a small handful of sites that can have a status other than In-Progress or Completed. But there are.
JimmXinu is offline   Reply With Quote