"Group by..." and persistent folder views

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
coldchemical
Posts: 2
Joined: 09 Mar 2017 22:08

"Group by..." and persistent folder views

Post by coldchemical »

Hi, I just today installed XYplorer to try it out, and generally speaking I quite like it. There are however a few things which are going to be deal-breakers for me unless there's a way to resolve them.

1. Grouping. One of my favorite features in Windows Explorer is the ability to create in-folder groups, especially for things like date modified and filetype. These allow me to easily differentiate between categories without hiding anything through a filter. A kind of visual separator would also be acceptable (Today | Yesterday | A Long Time Ago | etc.)

2. Persistence. I've noticed that when I change the view mode to, say, thumbnails in my wallpaper folder, that same thumbnail view remains after navigating to my documents folder. Is there a way to permanently associate a given folder with a given view?

Thanks for any help

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

Re: "Group by..." and persistent folder views

Post by highend »

Welcome to the forum.

1. There is no inbuilt grouping feature (at least not like in WE) but you can "simulate" it via
combining "instant color filters" and a custom column that does the grouping. The CC
needs a script though...

E.g. for the custom column:

Code: Select all

    // Possible values for $P_CC_Trigger
    // "c" -> Date created
    // "m" -> Date modified
    // "e" -> File extension
    perm $P_CC_Trigger;

    $dateTrigger = regexmatches($P_CC_Trigger, "c|m");
    // Date (created or modified)
    if ($dateTrigger) {
        $date = property("#date.$dateTrigger", <cc_item>);
        // $date = property("#date.$dateTrigger", <curitem>);
        $diff = datediff($date, , "h");

        if ($diff <= 24)       { return "     Today"; }
        elseif ($diff <=   7*24) { return "    This week"; }
        elseif ($diff <=  31*24) { return "   This month"; }
        elseif ($diff <= 365*24) { return "  This year"; }
        else                  { return " A long time ago"; }

    // File extension
    } else {
        return gpc(<cc_item>, "ext");
    }
And for a button to activate / switch the colorfilters

Code: Select all

    perm $P_CC_Trigger;

    $mode = popupmenu("Extension;e|Date created;c|Date modified;m");
    if !($mode) { status "No mode selected, aborted!", "8B4513", "stop"; end 1==1; }
    $P_CC_Trigger = $mode;

    // Date (created or modified)
    if (regexmatches($mode, "c|m")) {
        $colorFilters = <<<>>>
L:age$mode: <=   24 h //today>000000,00EE00
L:age$mode: <=  168 h //this week>000000,24EE00
L:age$mode: <=  744 h //this month>000000,68EE00
L:age$mode: <= 8544 h //this year>000000,ACEE00
L:age$mode: >  8544 h //way older>000000,FFEE00
>>>;

    // File extension
    } else {
        // new (clever) $colorFilters definition...
    }

    #485; // Refresh list
    colorfilter($colorFilters, <crlf>);

2. Menu - View - Folder View Settings...
One of my scripts helped you out? Please donate via Paypal

coldchemical
Posts: 2
Joined: 09 Mar 2017 22:08

Re: "Group by..." and persistent folder views

Post by coldchemical »

Thanks for the reply highend. I'm disappointed to learn there isn't a way to add true groups, but I'll try out the method you suggested! I went into the settings and edited one of the custom columns with your script but I'm not sure how to display it. It isn't listed in the popup menu when I right-click a blank area of the column header bar. For the persistent folder view settings, is there a way to automatically save the current settings? Having to manually save the view for each and every folder seems unnecessarily tedious.

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

Re: "Group by..." and persistent folder views

Post by highend »

After defining a default folder view (that you'd like to use for the majority of your folders) and
saving a specific folder view for the directory you're currently in, have you looked at
Menu - View - Folder View Settings - Edit...?

You can add additional folders / wildcards in the first edit field, e.g.
D:\Music|E:\Music
[x] Include Subfolders

And instead of doing it from the menu you are always free to put the "Save Folder View" entry
on a keyboard shortcut, a button in the toolbar, the catalog, etc.
The necessary command ID is: #472

---

Right click in the column header
"Add Column"
Move it into the position you'd like (drag and drop)
Right click the new entry (named "(Undefined)"
"Select Custom Column..."
Choose the column you put the script into
One of my scripts helped you out? Please donate via Paypal

Post Reply