Table of Contents
Footer Plugin
Compatible with DokuWiki
- 2022-07-31 "Igor" yes
- 2020-07-29 "Hogfather" yes
- 2018-04-22 "Greebo" yes
- 2017-02-19 "Frusterick Manners" yes
Similar to headerfooter
This plugin allows you to automatically add a specific text section at the bottom of each page of a given namespace. This is done
- without having to be entered by the author of these pages and
- without the author of the page being able to change this given text.
The additional context is only shown in display mode, not in edit mode. All pages created or maintained in this namespace will get this additional text.
Installation
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
Usage
Footer template
To add footer text to pages in a namespace, you need to create a file named _footer.txt
in this namespace.
And to add footer text to pages in the namespace directory and its subdirectories create a file named __footer.txt
in the namespace directory.
Files beginning with “_” cannot be created or changed within DokuWiki. Instead, you have to create a file and upload it into the wanted namespace. If you don't want this behavior and you want to maintain data from within DokuWiki you have to define prefixes in the plugin settings, e.g. “hf” and “hfu”. In this case, you have to create the pages hf_footer
and hfu_footer
in the namespace directory.
Additional syntax
To avoid a certain page from the footer template (e.g. the start page) you can insert this special command
~~NOFOOTER~~
to the content of this page. Please note that this command is only replaced from the page text if there is a footer template exactly for the namespace of this page.
Example
The screenshot above shows this syntax:
a) The content of the page “mynamespace:example” is:
====== Example ====== This is an example of the footer plugin.\\ Up to the line you see the text of the Wiki page. ----
b) The content of the page “mynamespace:_footer” in the same namespace is:
And below the line comes the footer text :-D
This footer text is shown on each page of the namespace “mynamespace”.
Some tips
- The footer text supports the same markup syntax as you use in any common wiki page.
- If you only need a footer in pages of the subdirectory and not in the current directory, define an empty file
_footer.txt
(for example with only one linebreak) in the current namespace and additionally a file__footer.txt
for the subdirectories.
Problems
Why don't my pages react with this plugin?
- The most common reason is that due to the page cache, your page will delay to correctly display the newest version. A convenient way is that closing the plugin in plugin management and reopen it again. It'll refresh the cache. Another way to refresh a page is to add the parameter purge to the URL. Example:
http://www.example.com/namespace/page?purge=true
- Or use Toucher Plugin
- Be sure that your pages and
_footer.txt
are in the same level directory. - If the content of a page ends with special syntax e.g. with a table (no return after the table), put a linebreak at the beginning of the footer template to avoid corrupting this syntax.
Configuration and Settings
The default behavior is managed by the wiki admin through the Configuration Settings.
Name | Value | Description |
---|---|---|
separation | paragraph | (default) using a blank line as a split between the original text and header/footer text. (it means a new paragraph). |
nothing | using nothing as split, which means you have to deal with the border between the original text and header/footer text. | |
prefix namespace | Prefix for the footer template of the current namespace | |
prefix subnamespace | Prefix for the footer template of the sub-namespaces |
History
Previous versions
The footer plugin is a clone of the headerfooter plugin which isn't maintained for a long time. It also includes the enhancements of HeaderFooter2. But there are some special aspects to this:
- The header functionality of the original plugin is no longer supported because it breaks the section editing. If someone has an idea of how to enhance that feel free to add this function again.
- Now there is a possibility to define a prefix for the footer templates.
- You can exclude special pages with the command
~~NOFOOTER~~
Change Log
- 2020-10-06
- Initial release, copied from headerfooter plugin with its forks
- 2020-12-17
- Improved cache handling (I hope it's sufficient now)