Quote:
Originally Posted by ownedbycats
New question:
I created several user-categories to group the entries in taglike #fanficcat. (For several reasons, I prefer to leave the column itself as nonhierarchical entries.)
Attachment 199438
To find books that have entries not present in the categories, I search for #fanficcat:true AND @Fanfiction.Fandoms:.false. Is it possible to also check this with a template?
EDIT:
Code:
program:
if
$#fanficcat
&& !'Fandom' inlist user_categories()
then
'aaaa'
fi
|
That is one way, probably the best. However, you could use
Code:
ids = book_values('id', '#fanficcat:true AND @Fanfiction.Fandoms:.false', ',', 0)
then check if $id is in the returned list. This will be slow if it is used in a composite, OK in an action chain or a template search.
Quote:
Originally Posted by ownedbycats
In the book list, there's a stray comma at the beginning of this composite taglike. Where is it coming from?
EDIT: It goes away if I run the strcat through list_remove_duplicates.
|
It happens because there is always a comma at the end of the list, creating an empty item. When the list is sorted to be displayed the empty item is less than everything so it goes to the front.
The list_remove_duplicates() function also removes empty items.
The right fix is to remove the comma at the end with something like