Learn about DokuWiki
Learn about DokuWiki
Compatible with DokuWiki
Search and install the plugin using the Extension Manager.
This plugin enables you to modify the Dokuwiki template based on IP address, ACL level of the user, and day of the week. The wiki logo (image), tagline, and the wiki name can be rotated by day or changed based on the IP address of the user. The links and buttons at top 1) and side 2) of the template can be changed based on the ACL level of the user; similarly the actions that they trigger are also governed by the ACL level of the user.
Being able to make these kinds of changes based on IP address makes it possible to run a site which caters to more than one entity and to give each one its own tools, logo, etc. Changing by date makes it possible to freshen the appearance of a page for repeat visitors. The ability to restrict the kinds of tools users have access to can have use for sites that want to fine-tune access.
This plugin is compatible with the current
dokuwiki template and with templates modeled on it. It also has built-in accommodations for the monochrome template.
When the logo image is rotated by the plugin, it is in effect replacing the default logo image. This will be found in one of three directories, as specified here: changing_the_logo. Your own replacement images will be assumed to be in the same directory as the default logo. When the template loads the default logo, it also specifies the width of the image. Therefore, if your image is a different size from the default, then you will want to specify its width. The replacement images are specified in the Configuration Options as a comma-separated list of the image names with the widths separated from the the name by a space:
img1.png 64,img2.png 128,img3.png 256,img4.png, . . .
The images must be listed in the order in which they will be accessed. That is, if you choose to rotate them by days of the week, then the first image must be the Sunday image, the second Monday, etc. If you do not have enough images for the seven days, then the first image (Sunday) will act as the replacement. The same principle holds true if you are rotating the logos by IP address. The images and the IP addresses must be listed in the same order as you want them accessed. If there are more IP addresses than images, then the first image in your list will be used.
There is a transparent logo.png included in the distribution. Using that as your default logo will eliminate the momentary lag between the appearance of the default image and its replacement.
The same principle for rotation applies to rotating tag lines and wiki names, as described above for the logos. The lists of tag lines and wiki names must be in the order in which you want them accessed by either date or IP address. Sunday will access the first tag line or wiki name, the first IP address in your list or IPs will access the first tag line or wiki name. The default replacement tag or name will be the first in its list.
In order to implement tagline replacement, you have to set a Dokuwiki tagline in Dokuwiki's configuration settings. The tplmod plugin supports one level of HTML markup. For instance, you can set the Configuration tagline as
<b>My thoughts about things</b> and the plugin will leave the HTML in place and replace “My thoughts about things” with a new tagline. You could in fact set the Configuration tagline as follows:
<b></b>, then all of the taglines will automatically be bold.
tag_date_format is set, then a formatted date string will be output as the tag. The formatting uses a
php date string. For instance:
\T\o\d\a\y \i\s l F jS Y
This will output
Today is Tuesday July 4th 2017 (or whatever the date is). Notice that all the text which is not part of the actual date itself is escaped:
\T\o\d\a\y \i\s. Not every character has to be escaped, only those which wll be interpreted as formatting characters. The date tagline takes precedence over the rotating taglines, so you cannot have both a date tagline and rotating tagline. As with the rotating taglines, a Dokuwiki tagline must be set in the Configuration Manager.
There are two major groups of template tools, treated as groups in the Configuration Manager, and two additional tools treated individually:
If a user is not eligible to use a tool, the tool will not be displayed.
You control access to these tools by selecting from the Configuration Manager which of these tools you want to control and by setting the cut-off ACL level using the
acl_all configuration option. If, for instance, you set
EDIT then users with ACL of
EDIT or lower will not have access to the selected tools. For tools which are not included in the Dokuwiki core and appear in the Page tools, you can add them to the Page tools input box in the form of a key word from the url of the tool. For example, in the case of the overlay, entering the word
overlay in the input box would prevent the overlay window from appearing to users who do not have access.
If the Page tools
All option is selected, then all page tools will be hidden from users who fall under the
acl_all setting. If, however, you would like to exclude certain core tools from this blanket prohibition, you do this using the
By default, when a feature that triggers an action is hidden from the user, that action disabled. If the user profile facility is hidden, a url containing
do=profile will not open the user profile dialog. This behavior can be changed by setting the
blocking option to false.
The sidebar toggle mechanism is enabled by setting the
toggle_sidebar configuration option to
true. See mturner.org for an example of its use. The toggle is an action link at the top right of the page.
Tplmod was initially desiged for use with the default DokuWiki template. While tplmod should work with templates based on the DokuWiki starter template, there could be differences that stand in the way of some of the functions that tplmod provides. However, there is current built-in support for these templates:
background_color setting makes it possible to set the color of the browser area which surrounds the wiki. This can often be done using the “Template Style Settings” in the Admin panel. But there are some cases where this setting can be useful, as in the monochrome template, where the background color fills the entire browser area before the wiki page color is activated. This may cause a choppy effect as the background color for the wiki sections replace the browser color. The solution is to set the background color of the template to the page color in the “Template Style Settings”. Then the entire page is loaded using this background color, after which tplmod will set the surrounding background color. In the pattern set down by the current Dokuwiki template, the wiki page color is white (#ffffff) and the template background setting is
background_alt. For this to work you have to check off
default, which is the only option, and will trigger
background_alt or else enter the color code for the background color which you prefer.
|logos||Comma separated list of image names for home page logo: names only, not paths|
|ips||Comma separated list of IPs for rotation by IP. Rotations follow sequence of IPs|
|sitetools|| Site Tools
Remove the selected site tools. In the Dokuwiki template Site Tools are located at the top of the template.
|pagetools|| Page Tools
Remove the selected page tools. In the Dokuwiki template these are located along the right-hand side of the template. You can remove non-standard tools, using the input box: enter them as a comma separated list of unique words from their query strings or urls. Selecting
|profile||Remove User Profile link|
|search||Remove Search box|
|taglines||Comma separated list of taglines|
|tag_date_format||A PHP date format string. If present, this date string will be output as your tagline|
|acl_all||The ACL level required for access to the sitetoools and pagetools. Users with lesser ACL levels will be barred from access to these tools. Defaults to EDIT.|
|dateorip|| Rotate logos, tag lines, and wiki names by ip address or days of the week. Select
|rotatewhich||If rotating the logo and/or tagline, select which to rotate. You have a choice of NONE, LOGO,TAG, BOTH.|
|ptools_xcl|| If pagetools is set to
|rotate_title||Rotate the wiki name (title)|
|wiki_names||Comma separated list of wiki names|
|toggle_sidebar||Display a toggle link at the top of the page to page to hide and show the sidebar. Defaults to false.|
|blocking|| Prevent attempts to access hidden actions by adding
|background_color||The browser background color, i.e. surrounding the wiki page. See background_color_setting|