Daft topic titles aside, is it possible to use a CTB to show, say, the contents of a folder, and to have that menu change depending on what was in the folder?
I know the POM button changes based on what's selected in the list, but wasn't sure if this sort of functionality is available for custom buttons.
Dynamically Generated Menus
-
admin
- Site Admin
- Posts: 66350
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Dynamically Generated Menus
No, although TheQwerty has suggested a way to add this to scripting some time ago. It might come later.
FAQ | XY News RSS | XY X
-
jacky
- XYwiki Master
- Posts: 3106
- Joined: 23 Aug 2005 22:25
- Location: France
- Contact:
Re: Dynamically Generated Menus
I'm not exactly sure what's the intent here, but just to say: something somewhat like that, if not that, can be done. I mean, I do have a CTB that I use every day, that doesn't show me the same menu depending on things like what's the current location. Couldn't be easier, just have the button trigger a script like this one:the_hyrax_lord wrote:Daft topic titles aside, is it possible to use a CTB to show, say, the contents of a folder, and to have that menu change depending on what was in the folder?
I know the POM button changes based on what's selected in the list, but wasn't sure if this sort of functionality is available for custom buttons.
Code: Select all
// determine which script to load(/menu to show)
if ('D:\Projects' == substr(<curpath>, 0, strlen('D:\Projects')))
{
$script = 'mnu-projects';
}
elseif ('I:\WAMP\www' == substr(<curpath>, 0, strlen('I:\WAMP\www')))
{
$script = 'mnu-web-stuff';
}
elseif ('\\PC-ASSO\folder' == substr(<curpath>, 0, strlen('\\PC-ASSO\folder')))
{
$script = 'mnu-shared-loc';
}
else
{
$script = 'mnu-default';
}
// go
load $script;(Yes I'm showing up to bump "old" topics now. 'tis what I do when the heat sets in...
Proud XYplorer Fanatic
XYplorer Beta Club