An easy section editing facility
This plugin implements a simple section editing feature comparable to
the one available for MediaWiki
It adds link urls to headings so that users can edit the section below. Edit links are
enabeld only for those users that have edit access. Edit links are hidden unless you hover
with the mouse pointer over them and then displays the "Universal Wiki Edit Button"
Once installed, the plugin automatically enables sectional editing without any further
provisions. Note, that it will only detect headings created using TWiki-markup, that is
and the like. It is not sensitive to normal HTML-markup, so it
does not add an edit link to normal
Sections might be included into the current topic using INCLUDE
edit link will be adjusted approriately, allowing to edit the correct target topic and
then redirect back to the current topic it has been included to.
There are a couple of other plugins that try to implement a section editing feature, along with some
other more exotic features. The first plugin of that kind was TWiki:Plugins/SectionalEditPlugin
Later on, its functionality was extended to process sections in a broader sense in the
. By the time of this writing both plugins were about to
be merged again into one TWiki:Plugins/EditSectionPlugin
. These three plugins all depend
on an extra package called TWiki:Plugins/EditContrib
which factors out common code. In addition
EditContrib contains a patch to the TWiki core engine, available for TWiki-4.0 and TWiki-4.1.x.
All these plugins are currently non-functional on TWiki-4.2.
While first looking at the code of SectionalEditPlugin, it was clear very soon, that it
would be better to start from scratch and remove some features for the sake of a cleaner
implementation, that is in sync with recent developments, i.e. PatternSkin, NatSkin
and NatEditContrib in this area.
The other substantial difference between SectionalEditPlugin and EditChapterPlugin is
that while the former introduces additional code to save an isolated subsection back into the topic,
the latter always saves complete topics, despite the fact that only part of it is editable.
There are a couple of preference variables to influence how and which headings are processed:
|| min depth of heading to edit the sections, 1=h1, 2=h2, 3=...
|| max depth of headings to edit
|| icon to be used in the edit link
<img src="%$nopPUBURLPATH%/%TWIKIWEB%/EditChapterPlugin/uweb-g.gif" height="16" width="16" border="0" />
|| full format string to render the detected heading of a chapter
<span class="ecpHeading">$anchor</a>$heading<a class="ecpEdit" href="$url" title="Edit this chapter">$img</a></span>
|| variable to enable/disable the EditChapterPlugin
In addition to enable/disable the plugin using the
preference variable, it can also be enabled disabled using the
Dedicated chapters of a topic can be extracted using the
it takes the following parameters:
|| target topic name to extract the chapter from
|| target web name
|| specify a single chapter to be extracted
|| specify first chapter to be extracted, use
to to specify the last chapter
|| specify last chapter to be extracted, mostly used together with
|| specify to extract all chapters before the given one
|| specify to extract all chapters after the given one
|| enable/disable entity encoding, used when embeding into an HTML input element
for a real-world example, used as a cover to the standard edit
templates, thus hooking in section editing into the standard editing process.
For the purpose of simplicity a couple of shortcomings have to be accepted.
- parametrized includes: the plugin does not know anything about parametrized includes, that is it won't work as expected if a topic includes text from a named section of another topic using
- wysiwyg editor: it currently does not work work together with TWiki:Plugins/WysiwygPlugin
- explicit sectioning: users can't specify any other section to be editable in isolation (e.g. using some
<section> ... </section> markup) other than by giving the respective section a heading.
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server where TWiki is running.
Like many other TWiki extensions, this module is shipped with a fully
automatic installer script written using the BuildContrib.
- If you have TWiki 4.2 or later, you can install from the
configure interface (Go to Plugins->Find More Extensions)
- If you have any problems, then you can still install manually from the command-line:
- Download one of the
- Unpack the archive in the root directory of your TWiki installation.
- Run the installer script (
perl <module>_installer )
configure and enable the module, if it is a plugin.
- Repeat for any missing dependencies.
- If you are still having problems, then instead of running the installer script:
- Make sure that the file permissions allow the webserver user to access all files.
- Check in any installed files that have existing
,v files in your existing install (take care not to lock the files when you check in)
- Manually edit LocalSite.cfg to set any configuration variables.
Many thanks to the following sponsors for supporting this work: