Learn about DokuWiki
Learn about DokuWiki
This is an old revision of the document!
Compatible with DokuWiki
This plugin allows to move pages and namespaces including media files and automatically adjusts all links and media references that point to these pages. Unlike the old pagemove plugin this plugin uses the DokuWiki parser which allows it to correctly identify all links and nothing else.
Parts of this plugin, like some of the translated strings, some parts of the structure of the code and parts of the user interface have been taken from the old pagemove plugin by Gary Owen, Arno Puschmann and Christoph Jähnigen.
This plugin moves files inside your DokuWiki data directory and can automatically change a lot of pages. Even though the plugin has been successfully tested it is always possible that something doesn't work as expected in your case and your wiki might be left in an inconsistent state. This plugin is also still rather new and might behave incorrectly in certain cases.
Please make a backup before using this plugin, especially if you plan to make larger changes!
Warning: This plugin does not update ACL rules. For example if you had an ACL rule that read-protected a certain wiki page this rule won't have any effect anymore after moving that page.
When updating an existing installation of this plugin it might be necessary to de-install the old plugin version first and re-install the new version thereafter. Severe problems (e.g. inconsistent application menues with the old plugin screen combined with several unlogical [admin] buttons) have been observed after upating the plugin. For instance when originally installed on Dokuwiki release 2014-09-29 “Hrun” and updated onto Dokuwiki release 2015-08-10 “Detritus”.
If, for any reason, you used an FTP client to upload pages, you should “hit” (open) them to be sure the index is refreshed, otherwise the move plugins will fail to work on the page, or worth, forget to update link on those page.
Except for the single page rename, the plugin requires manager privileges to use it.
This is the main part of the plugin. To use it navigate to the page (or page in namespace) you want to change, then open the Admin menu and select the Move plugin from the list of additional plugins.
In the box switch between the current page or namespace and give a new location. Clicking start will preview your changes and you can start the move operation. To move a namespace with some pages in subspaces but none directly under the namespace, use the tree based move method.
To plan more complicated restructuring of your wiki, the move plugin comes with a tree-based Move Manager. Open it by clicking on the link in the Move screen, pictured above.
The Move Manager allows you to plan all moves and renames to be executed by drag'n'drop operations. Simply move pages, media files and namespaces to their desired locations until the tree represents the new layout you want to have.
One thing you cannot do with this method is to create a new namespace. If you need to do that, use the other interface to move one page or namespace to the new namespace. After that, the new namespace will appear in this interface so you can move everything else to it.
This feature is available to users and groups that have been configured through the
allowrename option in the config manager. It is automatically available on all templates that implement the
Actually it is defined in source code and only available for the templates
action/rename.php line 45).
Users can simply rename (or move) the page they are currently on.
The move plugin allows plugins to move their own data and to adapt their syntax when a page or media file is moved. Currently the following plugins support this:
Plugins not explicitly stating their compatibility are most probably not adjusted.
The move plugin emits the following events:
$IDand it can add additional pages whose syntax needs to be adjusted because of this move.
opts⇒ array – compatibility to old plugins, shouldn't be used
affected_pages⇒ array – page ids that are (possibly) affected by this move, initially populated from the
relation_referencesmetadata index. can be adjusted
src_id⇒ string – the original ID of the page
dst_id⇒ string – the new ID of the page
id– the id of the page that shall be modified
moves– the page moves that might affect the page
media_moves– the media moves that might affect the page
handlers– the array of handlers, see below for more information
$handlersarray, the key is the plugin name as it is given to the handler. The handler needs to be a valid callback, it will get the following parameters:
$handler. The first three parameters are equivalent to the parameters of the
handle()-function of syntax plugins,
$pluginnameis just the plugin name again so handler functions that handle multiple plugins/plugin parts can distinguish for which the match is. The last parameter is the handler object. It has the following properties and functions that can be used:
ns: id and namespace of the old page
new_ns: new id and namespace (can be identical to id and ns)
moves: array of page moves, the same as
movesin the event
media_moves: array of media moves, the sames as
media_movesin the event
adaptRelativeId($id): adapts the relative
$idaccording to the moves
Have a look at the include plugin for a relatively simple case of a plugin that handles page moves. These events might be subject to change though I'll try to keep them as compatible as possible. If you add your plugin to the list of supported plugins I'll have a look if I could break it before changing anything that might affect plugins.
Feel free to open a bug report if your plugin needs additional support from the move plugin.
Please report bugs and feature requests in the issue tracker.