Variables are short text fragments which are stored at a central point in your configuration. A variable in a Wiki page will be replaced by its content at the time of the page delivery.
Variables may contain Wiki mark-up code. It is guaranteed that variable replacement will be done before any other Wiki code translation takes place. For the tricky ones among you: Defining a variable inside a variable will not work.
The syntax is simple: {{VariableName}}. If PWP encounters an undefined variable, it will print its {Name}(!) like this. Names are case sensitive.
PWP can be configured to allow variable editing via web interface. In this case, variables must not contain double quotes ". These quotes will be silently replaced by single quotes.
Column / grid layout of Wiki pages
Have you wondered how the two column layout of the start page was done? PWP provides four predefined (invisible) variables:
Using these variables, you can divide up a page in an N x M matrix. One word to the style class 'layout'. The PWP style sheet defines colours and font sizes for tables in general. For an invisible layout table two different style classes are required; they are already defined in PWP's standard style sheet.
Names, Phone numbers, Disclaimers
Things you have to repeat on several pages which are subject to change could be stored inside a variable. For example the name and phone number of a sales person:
Please contact our business representative {{Sales}}.
might expand to:
Please contact our business representative Mr. Bob Smith (555-976388).
Menus
Just define a menu for your most important pages in a variable. Now you can include your menu on every page by a call to {{MyMenuVariable}}.
Dynamic linking
You want to link to a periodically changing featured article or something similar from several other pages? Just define a variable containing a Wiki link to the Wiki page:
$this->mVars['FeaturedArticle'] = "[[Congo]]" {{FeaturedArticle}}
PWP is distributed with several icons. You include the icons either as images using the common link/image syntax or you can define a variable containing the image tag. Storing an icon image tag or in a variable will save a lot of typing.
The icons have a size of 12x12 pixel and will fit into a line of text in most cases. Here are a few samples:
Calendar pages are created by a simple click on a link in the menu "Extras". There you will find the required links.
One link section creates an annual overview for copy and paste. The other link section creates Wiki pages; one detail page for each month and an annual overview.
The calendar pages can be used a kind of web log (blogging) with a short entry per day linking to bigger stories on further pages.
One last note: The names of weekdays and months are not hard coded, but taken from PHP. Ideally, PHP would receive this information from the current system.
Reports
New in 1.5.0 Reports are automatically generated Wiki pages containing links to other Wiki pages. A report collects information from a page in order to decide whether or not to include the page. Reports can be edited and exported just like any other Wiki page. The report creation is triggered from the menu "Extra". Reports help to structure content and to navigate within static pages.
a) Search reports
Search reports act like a file name search (the "Goto" form within the menu) or like a full text search. Instead of providing the results as list view, a report stores them in a Wiki page.
b) Marker reports
The second category of reports requires that each included Wiki page offers a report marker. PWP analyses the markers and includes or ignores a page. The marker follow the format:
Report names are case insensitive. PWP supports partial name matches, thus it is possible to generate very specific or more general reports using a suitable report name scheme. For example consider a report marker named %%Rivers.Europe:...%%. This allows you to generate a report for any marker starting with Rivers or to select only a sub category requesting a report for Rivers.Europe.
A report name have to be unique within a single Wiki page. But one page may contain many report markers for totally different reports.
It is not required that a report name and the name of the generated Wiki page are identical. The connection between report name and Wiki page is made within the report form.
The report markers can either be visible just like ordinary text or you can hide them within an editor comment: ! -- %%MyReport::2:%% -- !.
A detailed description is to be found within the corresponding report form, reachable via menu "Extra".
Table of contents report (TOC)
This report helps to organise your pages in a hierarchy. Each page belonging to the report provides information about the predecessor and its level relative to the predecessor within the marker fields.
This way of processing a TOC hierarchy enable you to move a chapter with a whole tree of subchapters within the hierarchy by just changing one predecessor on one page.
Keyword index report
You may connect one page with several keywords. The report provides a list of related pages for each keyword.
Besides this, the keyword index report is a really useful feature for portal pages. A portal page itself covers a wider theme and enumerates related sub themes. By using the sub theme as keyword, PWP will populate portal pages automatically. You get an enumeration of all sub themes with links to the corresponding Wiki pages.
The keyword index report enables self organising content: Each page classifies itself and provides a link to the report, too:
Instead of linking from each city to all other cities, you just link to the classification entry and join the corresponding report.
Trail map / teaser text report
A report for news or tutorial trail maps, etc. This type of report supports the usage of a teaser text. Optionally, you may provide a different heading and a sorting hint. The latter one is required for news pages.
Using local links for uploaded files
Within an intranet it might be more comfortable to access uploaded files via a local path or a Windows UNC path instead of executing a HTTP download. In order to do so, PWP offers the InterWiki link target '.'. If set and not empty, the path provided in this link target prepends the links to uploaded files in lists. Within Wiki pages use the usual syntax [{. myfile.doc}] or [-{. myimage.gif}].
Sample: $this->mIWiki['.'] = "file://d:/pwp/wiki/";
However, some user agents provide a security model that denies local links in web pages recieved via HTTP. For Firefox, there is an extension called "LocalLink" available that solves the problem.
(Powered by PWP Version 1-5-1)