View Single Post
Old 05-18-2021, 09:48 AM   #1
blar
Junior Member
blar began at the beginning.
 
Posts: 9
Karma: 10
Join Date: May 2021
Device: Kobo Clara HD
Column from multiples, with added prefixes

So, I had a tags field with multiple categories of tags. I decided it would be more useful in sorting to split this out into custom tag-like columns for each category. However, I still want a 'tags' style column that combines them all for viewing and for generating Kobo collections. I also want to add the prefixes I was using before.

I have zero experience with coding, so I am fumbling through this stuff. I tried this out first, and it seemed okay enough.

Code:
{tags:||, }{#ratingtags:||, }{#datetags:||, }{#authortags:||, }{#awardtags:||, }{#listtags:||, }{#wordcounttags}
However, when I tried to add in my prefixes to this template, I discovered they don't work for multiple tags, only for the first one in the list. Author, award, list, and word count tags all use prefixes. For example, this is what I used for my author tags (which are tags relating to authors, e.g. nationality, not author names, by the way).

Code:
{#authortags:|author.|, }
I found out a better way to do it thanks to a search and oren64's answer, adjusted for my names and prefixes as follows.

Code:
program:strcat(test(field('#authortags'), "author.", ""),re(field('#authortags'),", ", ", author."))
But I don't know how to combine this with the other columns, as just adding in the templates from the first example doesn't work. I've tried reading the documentation but my understanding breaks down at the modes part. I guess I could make more custom columns for each using what I know works and then combine them with templates, but that seems excessive and I'm sure there's a "right" way to do this.
blar is offline   Reply With Quote