A dropdown field that lets you select a directory in the public webroot of a craftCMS project. It's possible to define a root path (within the webroot) and filter multiple directories.
This plugin requires Craft CMS 3.0.0 or later.
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require amkdev/server-path-field
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for Server Path Field.
Server Path Field adds a custom FieldType to Craft CMS called Server Path. This lets you choose from any direcotry found in the webroot, which then returns the path as twig value.
This plugin is basic and not so useful as standalone, but it extends the possiblities of other extensions need a specific public path. For instance Server Files or GetFiles.
This plugin is distributed free of charge under the MIT License. The author is not responsible for any data loss or issues resulting from use of the plugin.
This plugin is based on the Asset Folder Field plugin by Ryan Whitney.
This plugin was made with the help of assets and code found within the CraftCMS community. These folks are not affiliated with this plugin in any way, though I greatly appreciate their contributions to the community.
Thanks to @mmikkel, whose IncognitoField plugin was heavily referenced and used as a general framework when using this plugin. 🎉
Thanks to @anubarak, whose StackExchange answer provided the basis for the folder finding logic. 🎉
And thanks to @landon, whose folder icon was used in the logo. 🎉