Set (different) sort order on specific folder

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
rossnet
Junior Member
Junior Member
Posts: 6
Joined: 2007-12-07, 17:30 UTC

Set (different) sort order on specific folder

Post by *rossnet »

Hello fellow TC users,

my usecase: I have all folder contents sorted by name, just for a specific folder I would like to use a different sort order (descending by date).

Is there already a way to achive this using Total Commander without manually changing the sort order when entering the specific folder and changing it back when exiting the folder?

Cheers
Thorsten
User avatar
solid
Power Member
Power Member
Posts: 747
Joined: 2004-08-09, 11:20 UTC

Re: Set (different) sort order on specific folder

Post by *solid »

Yes, there is. To accomplish this, follow these steps:

Go to Settings > View Modes.
Create a new view mode with your desired sorting order.
Next, in Auto Switch Mode, set a rule for when this view mode will be activated. That is, set it to activate when entering a specific directory.
rossnet
Junior Member
Junior Member
Posts: 6
Joined: 2007-12-07, 17:30 UTC

Re: Set (different) sort order on specific folder

Post by *rossnet »

Thank you for your lighning fast reply.

Based on that I managed to activate the new view mode (with the desired sort order) on entering the directory using a "must match" rule with the <target-directory> as value, but didn't manage to switch back to default view mode when exiting that directory.

I've tried:
- must not match <target_directory>
and
- must match <parent_of_target_directory>

Is there a way to achive the switch to default (or any other view mode)?

It would be nice to have an option in the "Auto Switch Mode" to switch back to default if the rule does not (no longer) match.

Cheers
Thorsten
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Set (different) sort order on specific folder

Post by *Horst.Epp »

You have to set the <Default> view mode to the settings you want outside of your defined Auto-View modes.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
petermad
Power Member
Power Member
Posts: 14791
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Set (different) sort order on specific folder

Post by *petermad »

You can also put a sorting command in the "Auto-run commands" field. If you put the command after a | it will be performed when the view mode is left - for example if you want to revert to name sorting use this:

Code: Select all

|cm_SrcByName 1
You can also make TC remember the current sort order before you go into the directory, and then restore it afterwards - for example if you want to sort by Date in the folder:

Code: Select all

*cm_SrcByName 8,cm_SrcByDateTime 2|cm_SrcByName 9
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
rossnet
Junior Member
Junior Member
Posts: 6
Joined: 2007-12-07, 17:30 UTC

Re: Set (different) sort order on specific folder

Post by *rossnet »

Thanks a lot for your feedback @horst.Epp & petermad.

Explicitly setting the preferred sort order in default mode already did the trick for me. But the command feature seems also interesting for more advanced use cases.
Post Reply