#Filesystem
You can use any tools or packages you want to access the filesystem. The working directory your Addon runs from is its "code" directory as returned by cms.getCodePath()
. The examples on this page use static-cms-addon
. To see how to get these values from any language via the HTTP API, see State.
#Storage Path
Ex: /home/ubuntu/sites/my-site/local/cms/addon/my-addon/storage
When your Addon is installed, a special directory is created for your Addon for storing files. You are free to create any directories and files you need in this directory. You can use await cms.getStoragePath()
to get the path to this directory.
#Code Path
Ex: /home/ubuntu/sites/my-site/local/cms/addon/my-addon/code
When your Addon is installed, a special directory is created for your Addon's code. This directory will contain all of the files included in the Addon Package. This is also the working directory your Addon runs from. You can use await cms.getCodePath()
to get the path to this directory.
#Asset Path
Ex: /home/ubuntu/sites/my-site/local/cms/asset
The Asset Path is where all of the site's Assets are stored. You can use await cms.getAssetPath()
to get the path to this directory. This directory is the same for all Addons and available from the Assets Screen in the interface.