View Single Post
Old 03-20-2021, 05:34 AM   #2
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,197
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
does the below template do what you want?

Code:
program:
    f = field('#taglike');
    icons = '';
    sep = ':';
    for keyword in 'foo,bar,test':
        val = contains(f, keyword, strcat(keyword, '.png'), '');
        if val then
            icons = list_union(icons, val, sep)
        fi
    rof;
    ifempty(icons, 'unknown.png')

Last edited by capink; 03-20-2021 at 06:10 AM.
capink is offline   Reply With Quote