Recent Changes - Search:

add Cookbook page

hide

Cookbook


hide

Topics


show

Changed

Visitor's book Site map pmwiki-2.3.32

Wiki Header

Summary: Replace the PmWiki skin template page header with Wiki page header
Version: 1.0
Prerequisites: None
Status: Mature
Maintainer: Simon

Questions answered by this recipe

Questions:

Why is the PmWiki default skin page header part of the template rather than a wiki page?

How do I make a page header that is a PmWiki page like the side bar?

Answer: Follow the instructions below

Description

Change the PmWiki skin template (.tmpl) file to use a wiki page as header. This may apply to other skin? template files as well, but some use already a Wiki page for the header.

1: change the PmWiki skin template

Replace the lines close to the front of the template file (eg pmwiki.tmpl)

<!--PageHeaderFmt-->
  <div id='wikilogo'><a href='{$ScriptUrl}'><img src='$PageLogoUrl'
    alt='$WikiTitle' border='0' /></a></div>
  <div id='wikihead'>
  <form action='{$ScriptUrl}'>
    <span class='headnav'><a href='{$ScriptUrl}/$[{$Group}/RecentChanges]'
      accesskey='$[ak_recentchanges]'>$[Recent Changes]</a> -</span>
    <input type='hidden' name='n' value='{$FullName}' />
    <input type='hidden' name='action' value='search' />
    <a href='{$ScriptUrl}/$[{$SiteGroup}/Search]'>$[Search]</a>:
    <input type='text' name='q' value='' class='inputbox searchbox' />
    <input type='submit' class='inputbutton searchbutton'
      value='$[Go]' /></form></div>
<!--/PageHeaderFmt-->

with the lines

<!--PageHeaderFmt-->
  <!--wiki: {$DefaultGroup}.Header {$Group}.HEader {$SiteGroup}.Header-->
<!--/PageHeaderFmt-->

2: create the page Site.Header

Use the following as the basis for your site page header

(:Summary: Website page header:)
(:div class='lastmod' style="font-size:smaller;":)
$[Page last modified on {*$LastModified}]
(:divend:)
(:div class='footnav' rel='nofollow' style="font-size:smaller;":)
%rel='nofollow' class=edit    accesskey=$[ak_edit]%     [[{*$FullName}?action=edit  | $[Edit] ]] -
%rel='nofollow' class=diff    accesskey=$[ak_history]%  [[{*$FullName}?action=diff  | $[History] ]] -
%rel='nofollow' class=print   accesskey='$[ak_print]'%  [[{*$FullName}?action=print | $[Print] ]] -
%rel='nofollow' class=changes accesskey='$[ak_recentchanges]'% [[{*$Group}/RecentChanges | $[Recent Changes] ]] -
%rel='nofollow' class=search  accesskey='$[ak_search]'% [[{$SiteGroup}/Search | $[Search] ]]
(:divend:)

This will give the same result as the standard PmWiki page header.

Notes

This header first shows any header in the default group ($DefaultGroup) and alternatively the header from the site group ($SiteGroup}.

This recipe provides an obvious improvement to the flexibility of PmWiki by making the page header customisable in a similar way to the side bar.

Release notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

See also

Contributors

tahi Page last modified on 2023 Dec 31 20:35

Edit - History - Recent Changes - WikiHelp - Search - email page as link -> mailto:?Subject="KiwiWiki: Wiki Header"&Body=