[SOLVED] Custom Column List of Icons via #Tags

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
xypme
Posts: 2
Joined: 16 Nov 2017 09:28

[SOLVED] Custom Column List of Icons via #Tags

Post 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;
Last edited by xypme on 16 Nov 2017 12:54, edited 1 time in total.

highend
Posts: 15004
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

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

Post 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;
One of my scripts helped you out? Please donate via Paypal

xypme
Posts: 2
Joined: 16 Nov 2017 09:28

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

Post by xypme »

yes! thank you! :appl:

Post Reply