Page 1 of 1

[SOLVED] Custom Column List of Icons via #Tags

Posted: 16 Nov 2017 10:04
by xypme
Question: [SOLVED] Custom Column List of Icons via #Tags
Goal: using the Custom Column, List of Icons to show multiple icons on same row based on how the file is tagged using #Tags
is this possible? is my code in error? --- below is the code/script I am currently with (not working, it shows only one icon (should be two based on example), and also appears on every row). I've attempted this script in multiple ways, none have worked consistently. Any ideas/help?
fyi - using the latest xyplorer stable ver.18.50.0200

Code: Select all

//adds multiple icons based on tags
 $item = tagitems("tags");
 $iconlist = " ";
 //Tag:_OftenUsed
 if (strpos($item, "_OftenUsed") != -1)
    {
     if ( $iconlist != " "){$iconlist = $iconlist .";BlockGreen.ico";} 
     if ( $iconlist == " "){$iconlist = "BlockGreen.ico";}
    }
 //---
 //Tag:_personal
 if (
     strpos($item, "_personal") != -1
    )
    {
     if ( $iconlist != " "){$iconlist = $iconlist .";BlockRed.ico";} 
     if ( $iconlist == " "){$iconlist = "BlockRed.ico";}
    }
 //---
 return $iconlist;

Re: Custom Column List of Icons via #Tags ...possible? help?

Posted: 16 Nov 2017 10:24
by highend
Without using the correct variable names in a custom column script...

tagitems() requires <cc_item> to return the correct tag for each entry in the list.
So e.g. this would work:

Code: Select all

    //adds multiple icons based on tags
    $iconlist = "";
    $tags = tagitems("tags", , <cc_item>);
    //Tag:_OftenUsed
    if (strpos($tags, "_OftenUsed") != -1) {
        $iconlist = $iconlist . ((!$iconlist) ? "BlockGreen.ico" : ";BlockGreen.ico");
    }

    //Tag:_personal
    if (strpos($tags, "_personal") != -1) {
        $iconlist = $iconlist . ((!$iconlist) ? "BlockRed.ico" : ";BlockRed.ico");
    }
    return $iconlist;

Re: Custom Column List of Icons via #Tags ...possible? help?

Posted: 16 Nov 2017 12:52
by xypme
yes! thank you! :appl: