Remap Topics Plugin
Plugin that allows to reorganize whole webs and manage redirects for old topics to the new ones using a map.
Introduction
This plugin is designed to support reorganizing webs and renaming whole topics. The old topics do not exit anymore but a map in the topic
RemappedTopics in each web can list up all old topics and the new topics that they should be redirected to. Viewing an old topic that has a mapping will result in a redirect to the new one.
For attachments the redirect is limited to a redirect to the topic containing the attachment, not the attachment itself.
Implementation and Integration
The plugin provides two variables which both are not used directly by site content managers. The variable
%REMAPTOPICS%
is placed in the
WebTopicViewTemplate and
WebTopicNonWikiTemplate topics in each web. When a topic that does not exist is viewed, one of the two topics is displayed instead. The variable will trigger a redirect to the new topic if the non-existant topics has a mapping defined in the webs
RemappedTopics topic.
Similarly, the variable
%REMAPTOPICATTACHMENTS%
is inserted in the
no_such_attachment
template in the file
templates/messages.tmpl
like this:
%TMPL:DEF{"no_such_attachment"}%
%REMAPTOPICATTACHMENTS%
...
%TMPL:END%
The variable will trigger a check if the attachment was from a remapped topic and redirects to the topic.
How the Maps Work
The
RemappedTopics topic can contain any number of tables with at least two columns (additional columns are ignored). Tables headings are ignored.
The first column contains the old topics, the second column the new topics. There are three types of entries for old topics:
- OldTopic
- A single topic that will be directed to NewTopic.
- OldTopic+
- An entire topic tree with OldTopic as top level that will be mapped to NewTopic and its subtopics. The subtopic part of the name must be the same for the old and new topics.
- OldTopic*
- Works similarly as OldTopic+ but will additionally find the best-matching subtopic under NewTopic if there is no direct match. This is done by removing one character at a time from teh subtopic under NewTopic until a topic with that name exists.
The old topics can be prefixed with an exclamation mark to prevent rendering them as links to inexisting topics.
The list of mappings is processed from top to bottom. This allows to put general remappings at the top and map more specific topics below.
Plugin Installation Instructions
This plugin is part of
iiTWiki.
Plugin Info
Related Topics: TWikiPlugins,
DeveloperDocumentationCategory,
AdminDocumentationCategory,
TWikiPreferences