diff options
Diffstat (limited to 'doc/md/dev')
-rw-r--r-- | doc/md/dev/Plugin-system.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/md/dev/Plugin-system.md b/doc/md/dev/Plugin-system.md index a87bd0cf..c29774de 100644 --- a/doc/md/dev/Plugin-system.md +++ b/doc/md/dev/Plugin-system.md | |||
@@ -139,6 +139,20 @@ Each file contain two keys: | |||
139 | 139 | ||
140 | > Note: In PHP, `parse_ini_file()` seems to want strings to be between by quotes `"` in the ini file. | 140 | > Note: In PHP, `parse_ini_file()` seems to want strings to be between by quotes `"` in the ini file. |
141 | 141 | ||
142 | ### Understanding relative paths | ||
143 | |||
144 | Because Shaarli is a self-hosted tool, an instance can either be installed at the root directory, or under a subfolder. | ||
145 | This means that you can *never* use absolute paths (eg `/plugins/mything/file.png`). | ||
146 | |||
147 | If a file needs to be included in server end, use simple relative path: | ||
148 | `PluginManager::$PLUGINS_PATH . '/mything/template.html'`. | ||
149 | |||
150 | If it needs to be included in front end side (e.g. an image), | ||
151 | the relative path must be prefixed with special data `_BASE_PATH_`: | ||
152 | `($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH . '/mything/picture.png`. | ||
153 | |||
154 | Note that special placeholders for CSS and JS files (respectively `css_files` and `js_files`) are already prefixed | ||
155 | with the base path in template files. | ||
142 | 156 | ||
143 | ### It's not working! | 157 | ### It's not working! |
144 | 158 | ||