Manager plugin: favorite files/folders tab in the left tree.
- Plugin creates a tab in the Manager left menu, next to the documents tree.
- Add any files/folders to favorites.
- List is automatically sorted alphabetically.
- Favorites under a favorited folder are grouped into a nested tree:
- Children show a path relative to that folder.
- Within a group, files come before nested folders.
- If a folder has 2 or more direct children (a file or a nested folder), an auto folder is created (and removed when fewer than two children remain).
- For example, manually added:
assets/modules/assets/plugins/ddManagerFavorites/ddManagerFavorites.jsassets/plugins/ddManagerFavorites/tpl/item.htmlassets/plugins/ddManagerFavorites/tpl/tab.htmlassets/snippets/ddRunSnippets/src/Snippet.php
- Result:
assets/— auto foldermodules/— folder added manuallyplugins/ddManagerFavorites/— auto folderddManagerFavorites.jstpl/— auto folderitem.htmltab.html
snippets/ddRunSnippets/src/Snippet.php
- For example, manually added:
- Removing a favorited folder also removes all favorites nested under it.
- Click opens file edit (with focus on textarea) or folder view.
- Removed favorites can be viewed in trash (toolbar button) and restored.
- Favorites are stored in the browser (in
localStorage), to avoid overloading the database (write in the support chat, if you prefer the database, we will think about this).
- PHP >= 7.4
- (MODX)EvolutionCMS >= 1.4
- (MODX)EvolutionCMS.libraries.ddTools >= 0.69
- jQuery >= 1.11.1 (Manager already provides it)
- jQuery.ddTools >= 4.2.1 (shipped with the plugin)
Just run the following PHP code in your sources or Console:
// Include (MODX)EvolutionCMS.libraries.ddInstaller
require_once(
$modx->getConfig('base_path')
. 'assets/libs/ddInstaller/require.php'
);
// Install (MODX)EvolutionCMS.plugins.ddManagerFavorites
\DDInstaller::install([
'url' => 'https://github.com/DivanDesign/EvolutionCMS.plugins.ddManagerFavorites',
]);- If
ddManagerFavoritesis not exists on your site,ddInstallerwill just install the plugin. - If
ddManagerFavoritesis already exists on your site,ddInstallerwill check it version and update it if needed. - After installation, set the system event
OnManagerTreeRenderin the plugin settings (ddInstallerdoes not yet support events).
- Plugin name:
ddManagerFavorites. - Description:
<b>1.1</b> Manager favorite files/folders tab.. - Category:
Core → Manager. - Parse DocBlock:
no. - Plugin code (php): Insert content of the
ddManagerFavorites_plugin.phpfile from the archive. - System Events:
OnManagerTreeRender.
- Create a new folder
assets/plugins/ddManagerFavorites/. - Extract the archive to the folder (except
ddManagerFavorites_plugin.php).