amkdev/server-path-field

Craft CMS field type that provides a dropdown field that let you select a server path within the webroot.

1.0.0.5 2023-11-06 06:48 UTC

This package is auto-updated.

Last update: 2025-03-06 09:31:37 UTC


README

Plugin Icon: A folder with a dropdown arrow on a blue background.

Server Path Field plugin for Craft CMS 3.x

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.

Requirements

This plugin requires Craft CMS 3.0.0 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require amkdev/server-path-field
    
  3. In the Control Panel, go to Settings β†’ Plugins and click the β€œInstall” button for Server Path Field.

Server Path Field Overview

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.

Disclaimer

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.

Special Thanks

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. πŸŽ‰