HeaderFooter

Home location: Home location where unfortunately the download link is broken
Following is a rewrite of action.php (in detail, a rewrite of handle_parser_wikitext_preprocess). Enhancements are:

  1. Support for non default storage path for data, especially for farms. Uses Dokuwiki functions instead of custom written
  2. Support for inheritance, using __header.txt and __footer.txt (two underscores). Mechanism is same and the implementation is based on code for namespace_templates
  3. Support for replacement patterns as shown here.

The plugins below is rewrite and enhanced:
HeaderFooter Enhanced

Examples/Usage

  • Header in the same level files:
    • _header.txt (One underscore)
  • Header for inheritance in the following levels:
    • __header.txt (Two underscore)

To add header or footer text to pages in a namespace, you need to create a file named _header.txt or _footer.txt in the namespace directory (root namespace is under data/pages), which contains all you need to add. Then, put the file in a namespace. It's all! Easy enough ? Yes, just like what the page template does!

Some tips

  • Remember: the _header.txt and _footer.txt support the same markup syntax as you use in any common wiki page.
  • Be careful for using head line, because we don't want to see any “EDIT” button in the suplus text.
  • Currently in a namespace, only the same level pages are influenced by _header.txt or _footer.txt, subdirectories are not influenced. (If needed, just put the same _header.txt/_footer.txt in subdirectories)
  • For some non-English languages, think of the files' encoding. UTF-8 is preferable.

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
  • Be sure that your pages and _header.txt/_footer.txt are in the same level directory.
EivindEivind, 05 May 2017
Which is why I was very happy when I saw that the HeaderFooter plugin had been enhanced! I didn't even have to use ~~NOCACHE~~ on the pages for PageNav to get the correct links. :)
I wish I could say that all is good, but I still have issues with the page caching.

Whenever I update my pages (locally, then upload) I often find they don't have the footer. You give tips for clearing the cache, but since I'm using this on nearly 30,000 pages, purging each one isn't a sound option. I found that disabling and enabling the plugin also doens't work in all circumstances.
Enter your comment: