aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/md
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-09-22 12:44:08 +0200
committerArthurHoaro <arthur@hoa.ro>2020-09-22 13:50:19 +0200
commit76fe68d924d424283d0a1784c5f5e7582dda3a00 (patch)
tree51d1d7f27a4ad12c67467932aba70049da8c4234 /doc/md
parent0d930454a2892715e691f9c7713e26a3bb4ee96c (diff)
downloadShaarli-76fe68d924d424283d0a1784c5f5e7582dda3a00.tar.gz
Shaarli-76fe68d924d424283d0a1784c5f5e7582dda3a00.tar.zst
Shaarli-76fe68d924d424283d0a1784c5f5e7582dda3a00.zip
Fix plugin base path in core plugins
Also fix note check in archiveorg plugin, and regression on vintage template. Documentation regarding relative path has been added. Fixes #1548
Diffstat (limited to 'doc/md')
-rw-r--r--doc/md/dev/Plugin-system.md14
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
144Because Shaarli is a self-hosted tool, an instance can either be installed at the root directory, or under a subfolder.
145This means that you can *never* use absolute paths (eg `/plugins/mything/file.png`).
146
147If a file needs to be included in server end, use simple relative path:
148`PluginManager::$PLUGINS_PATH . '/mything/template.html'`.
149
150If it needs to be included in front end side (e.g. an image),
151the relative path must be prefixed with special data `_BASE_PATH_`:
152`($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH . '/mything/picture.png`.
153
154Note that special placeholders for CSS and JS files (respectively `css_files` and `js_files`) are already prefixed
155with the base path in template files.
142 156
143### It's not working! 157### It's not working!
144 158