The most important thing for a plugin is the
Plugin Namespace
-
$:/plugins/<author>/<pluginnmame>/<title>
eg:
$:/plugins/<author>/<pluginnmame>/readme
$:/plugins/<author>/<pluginnmame>/license
-
$:/plugins/<author>/<pluginnmame>/config
… optional if needed
- and so on …
Config tiddlers
-
$:/config/<plugin-name>/<config-title>
are an exception, because they can be part of the plugin, but start with $:/config/
- They still should have a relation to the plugin, so they are easily identifiable.
- The best way to work with config tiddlers is, to not package them at all, but work with sensible default values, if the config tiddler is missing.
That’s the way we work with most configuration tiddlers in the core. They only exist, if users need to change them. Only if there is no other way they are shipped with the plugin.
Installing a Plugin
- Plugins should never automatically overwrite config tiddlers from other plugins.
- Plugins can rely on core config tiddlers, but only the user should overwrite them.
- Core config tiddlers, can be listed in the plugin settings tab if needed.
Overwriting core tiddlers
Should be avoided if possible. It creates maintenance burden for users and plugin authors.
- Plugins should clearly identify core tiddlers, that are overwritten by the plugin in the readme
- If possible only portions of existing core macros should be overwritten, if possible.
- Many core macros allow to overwrite default templates. If that’s possible plugins should use that mechanism
Identifying core tiddlers that are overwritten by the plugin can be done with a filter.
eg: my AdvancedSearchPlus plugin uses the following filter and info text in the readme.
''Important'': This plugin modifies several core templates
<ul>
<$list filter="[[$:/plugins/wikilabs/advanced-search-plus]plugintiddlers[]prefix[$:/core/]] $:/AdvancedSearch">
<li><$link to=<<currentTiddler>>><<currentTiddler>></$link></li>
</$list>
</ul>
This makes it easier for users to identify update problems.
Plugin Settings
IMO plugin settings (only if needed) should also be part of the ControlPanel → Settings → Author → Plugin Name tab — This is no “hard rule”, but I think it makes sense.
See ControlPanel Settings Screenshot
Since I do have so many plugins and if there are several of them installed, I moved the settings / config options into it’s own tab. I think that’s better than “polluting” the default settings tab.
I think that’s the basic rules I follow with my plugins.