View Single Post
Old 04-04-2021, 09:46 PM   #1
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,106
Karma: 77213681
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Template: Prioritizing an item in sublists

I have this template for display of two columns in Kobo subtitles and Generate Covers:
Code:
{#taglike:'sublist(list_sort($, 0, ','), 0,1,',')'}  | {#anothercolumn}
Is there a way to make it so that if a specific value is present in #taglike, it is prioritized and appears instead of the first sorted one?

I see in the documentation about indexes, but that seems to be about what order it is in rather than a specific value.

e.g. if 'abc, bar, foo' appears it currently shows 'abc.'
I want to prioritize 'bar' so that it appears instead even though it is not first.
But 'bar' may not always be the second item in the list, e.g. 'aaa, aaaaaaaah, ahhhhhhhhh!!!, bar' or 'bar, random screaming'

I am thinking maybe sublists won't work for this, but something like list_re.

Context: The template is for displaying fanfic information. I want it to show 'Crossovers' if that value appears in #fanficcat.


Last edited by ownedbycats; 04-05-2021 at 01:58 AM.
ownedbycats is offline   Reply With Quote