Aktuelle Änderungen - Suchen:

PmWiki (deutsch)

Bearbeiten


Englisch: Site/SideBar

FAQ

Administratoren (deutsche Übersetzung der Seite PmWiki.FAQ, Stand englisch)

This attempts to summarize some of the more commonly asked questions. The answers are on the corresponding pages (see link). If you have a question that isn't answered here, you can leave your question on the Questions page or search for documentation using the Site.search facility. More documentation can be found on the documentation index page. Or see how to get assistance.

Introduction

What is PmWiki?

PmWiki pages look and act like normal web pages, except they have an "Edit" link that makes it easy to modify existing pages and add new pages into the website, using basic editing rules. You do not need to know or use any HTML or CSS. Page editing can be left open to the public or restricted to small groups of authors.

Key PmWiki Features

Custom look-and-feel: A site administrator can quickly change the appearance and functions of a PmWiki site by using different skins and HTML templates. If you can't find an appropriate skin already made, you can easily modify one or create your own.
Access control: PmWiki password protection can be applied to an entire site, to groups of pages, or to individual pages. Password protection controls who can read pages, edit pages, and upload attachments. PmWiki's access control system is completely self-contained, but it can also work in conjunction with existing password databases, such as .htaccess, LDAP servers, and MySQL databases.
Customization and plugin architecture: One principle of the PmWikiPhilosophy is to only include essential features in the core engine, but make it easy for administrators to customize and add new markup. Hundreds of features are already available by using extensions (called "recipes") that are available from the PmWiki Cookbook.

PmWiki is written in PHP and distributed under the General Public License. It is designed to be simple to install, customize, and maintain for a variety of applications. This site is running pmwiki-2.2.0-beta68.

PmWiki is a registered trademark of Patrick R. Michaud.

What can I do with it?

PmWiki pages look and act like normal web pages, except they have an "Edit" link that makes it easy to modify existing pages and add new pages into the website, using basic editing rules. You do not need to know or use any HTML or CSS. Page editing can be left open to the public or restricted to small groups of authors. Feel free to experiment with the Text Formatting Rules in the "Wiki sandbox". The website you're currently viewing is built and maintained with PmWiki.

What are the requirements?

See the PmWiki requirements page.

Where can I find documentation?

See the documentation index page.

How can I download PmWiki?

See the download page.

How do I install PmWiki?

Instructions for installation are on the installation page.

How do I get help with PmWiki?

See How to get assistance

Basic PmWiki editing rules

I'm new to PmWiki, where can I find some basic help for getting started?

The Basic Editing page is a good start. From there, you can just follow the navigational links at the bottom of the page (they are called Wiki Trails) to the next pages, or to the Documentation Index page, which provides an outline style index of essential documentation pages, organized from basic to advanced.

How do I include special characters on my wiki pages?

Use character codes to insert special characters, such as Copyright (©) and Trademark (® or ™) symbols, that don't appear on your keyboard.

Why are separate lines of text in the markup combined into a single line on output?

PmWiki normally treats consecutive lines of text as being a paragraph, and merges and wraps lines together on output. This is consistent with most other wiki packages. However, an author can use the (:linebreaks:) directive to cause separate lines of markup text to be kept as separate lines in the output.

Can I just enter HTML directly?

By default (and by design), PmWiki does not support the use of HTML elements in the editable markup for wiki pages. There are a number of reasons for this described in the PmWiki Philosophy and PmWiki:Audiences. Basically, Pm feels that enabling HTML markup within wiki pages in a collaborative environment has the effect of excluding some potential authors from being able to edit pages, as well as posing a number of display and security issues. However, a site administrator can use the Cookbook:EnableHTML recipe to enable the use of HTML markup directly in pages.

Where can I find more documentation?

See the documentation index page.

Creating New Pages

How do I create a new page?

Typing my new page? will create a link to the new page?. Also, on sites that have WikiWords enabled as link-creating syntax, typing MyNewPage will create a link to the new page. WikiWords are CapitalizedWordsSmashedTogether, and, on such sites, don't need double brackets to become links. Note that some sites have turned off WikiWord links -- including this one! There's a lot you can do with double bracket links.

Why do some new pages have a title with spaces like "Creating New Pages" and others end up with a WikiWord-like title like "CreatingNewPages"?

The default page title is simply the name of page, which is normally stored as "CreatingNewPages." However, you can override a page's title by using the (:title Creating New Pages:) markup. This is especially useful when there are special characters or capitalization that you want in the title that cannot be used in the page name.

Links

How do I create a link that will open as a new window?

Use the %newwin% wikistyle, as in:

%newwin%http://example.com/

http://example.com/

How do I create a link that will open a new window, and configure that new window?

This requires javascript. See Cookbook:PopupWindow.

How do I place a mailing address in a page?

Use the mailto: markup, as in one of the following:

* mailto:myaddress@example.com
* [[mailto:myaddress@example.com]]
* [[mailto:myaddress@example.com |
email me]]
*
[[mailto:myaddress@example.com?subject=Some
subject&body=Body text | email me]]

See also Cookbook:EProtect or Cookbook:ProtectEmail for information on protecting email addresses from spammers.

How can I enable links to other protocols, such as nntp:, ssh:, xmpp:, etc?

See Cookbook:Add Url schemes How to get PmWiki to recognize additional URL schemes such as irc:, nntp:, etc.

How do I make a WikiWord link to an external page instead of a WikiPage?

Use link markup. There are two formats:

[[http://example.com/ | WikiWord]]
[[WikiWord -> http://example.com/]]

How do I find all of the pages that link to another page (i.e., backlinks)?

Use the link= option of the (:pagelist:) directive, as in

(:pagelist link=SomePage list=all:)   -- show all links to SomePage
(:pagelist link={$FullName} list=all:)  -- show all links to the current page

What link schemes does PmWiki support?

See Link schemes Link schemes supported by PmWiki

How do I open external links in a new window or mark them with an icon?

See Cookbook:External links Configure external links to open in a new window, have a "tooltip title", or use other CSS classes

How can I use an image as a link?

See Images#links

Images

Is it possible to link an image on PmWiki without using a fully qualified URL?

Yes. For images that are attachments, the general format is Attach:Groupname/image.gif. To link to an image that is on the same server, use Path:/path/to/image.gif.

Why doesn't the pct specification work in conjunction with lfloat and rfloat?

%rfloat width=10pct% http://pmichaud.com/img/misc/bubble.jpg"rfloat width
10%" 
%width=10pct% http://pmichaud.com/img/misc/bubble.jpg"width 10%"
[[<<]]
%lfloat height=20pct% http://pmichaud.com/img/misc/bubble.jpg"lfloat
height 20%" 
%height=20pct% http://pmichaud.com/img/misc/bubble.jpg"height 20%"
[[<<]]
%width=10pct rfloat% http://pmichaud.com/img/misc/bubble.jpg"width 10%
rfloat" 
%height=20pct lfloat% http://pmichaud.com/img/misc/bubble.jpg"height 20%
lfloat" 
rfloat width 10%
width 10%
lfloat height 20%
height 20%
width 10% rfloat
height 20% lfloat

Can I attach a client image file on PmWiki?

Yes, see Uploads

How can I include a page from another group that contains an attached image?

Include the page in the normal way, ie (:include GroupName.Pagename:). In the page to be included (that contains the image) change Attach:filename.ext to Attach:{$Group}/filename.ext.

Why, if I put an image with rframe or rfloat and immediatly after that I open a new page section with ! the section title row is below the image instead of on the left side?

Because the CSS for headings such as ! contains an element clear:both which forces this behaviour. Redefine the CSS locally if you want to stop this happening, but I think the bottom border (that underlines the heading) would need further re-definition. I just use bolding for the title, and 4 dashes below ---- to separate a new section, and it saves the effort of fiddling with the core definitions.

Unlike the lframe and rframe directives, cframe does not fully honour the width setting. While the frame itself resizes to match the request, the enclosed image does not, and retains its original width. Effect is the same in IE and Fx. I've added an example beneath the standard example above.

How can I put a table of captioned images within a numbered list? I cannot use a simple table, because images cannot (apparently) have captions within a simple table (Example 1). I cannot seem to use the table directives, because I cannot get them to work within a list without ending the list and causing subsequent numbering to restart (Example 2).

Table directives must start in column 1

Example 1

# First item
## First subitem
   || border=0 align=center
   ||
http://pmichaud.com/img/misc/pc.jpg"Paper
clips" | '''Figure 1''' ||
%width=50pct%http://pmichaud.com/img/misc/pc.jpg"Paper
clips" | '''Figure 2''' ||
## Second subitem
# Second item
  1. First item
    1. First subitem
      Paper clips | Figure 1Paper clips | Figure 2
    2. Second subitem
  2. Second item
Note caption (signified by bar) is not recognised, and an erroneous bar is displayed

Example 2

# First item
## First subitem
(:table border=0 align=center
margin-left:4em :)
(:cellnr:)
http://pmichaud.com/img/misc/pc.jpg"Paper
clips" | '''Figure 1'''
(:cell:)
%width=50pct%http://pmichaud.com/img/misc/pc.jpg"Paper
clips" | '''Figure 2'''
(:tableend:)
## Second subitem
(:table border=0 align=center
padding-left:4em :)
(:cellnr:)
http://pmichaud.com/img/misc/pc.jpg"Paper
clips" | '''Figure 1'''
(:cell:)
%width=50pct%http://pmichaud.com/img/misc/pc.jpg"Paper
clips" | '''Figure 2'''
(:tableend:)
# Second item
  1. First item
    1. First subitem
Paper clips
Figure 1
Paper clips
Figure 2
  1. Second subitem
Paper clips
Figure 1
Paper clips
Figure 2
  1. Second item
Use styles for indentation, you will have to resume the numbering, see Wiki styles

Not good enough

# First item
## First subitem
   || border=0 align=center
   ||
http://pmichaud.com/img/misc/pc.jpg"Paper
clips"[[<<]]'''Figure 1''' ||
%width=50pct%http://pmichaud.com/img/misc/pc.jpg"Paper
clips"[[<<]]'''Figure 2''' ||
## Second subitem
# Second item
  1. First item
    1. First subitem
      Paper clips
      Figure 1
      Paper clips
      Figure 2
    2. Second subitem
  2. Second item

Is it possible to disallow all images? I already disabled uploads but I also want to disallow external images from being shown on my wiki pages. - X

?

How can I make it so that when I place an image in a page, the block of text it is in is a <p> (paragraph) rather than a <div> (division)?

If you just want it to happen for a single image (instead of all), then try putting [==] at the beginning of the line, as in:

[==] http://www.pmwiki.org/pub/pmwiki/pmwiki-32.gif

Having [==] at the beginning of a line forces whatever follows to be part of a paragraph.

Is there any way to use relative paths for images?

See Cookbook:RelativeLinks .

Is there a way to attach a BMP and have it display rather than link?

PmWiki supports .bmp images out of the box. If you insist on using an uppercase extension see Cookbook:AddImageType.

Is there a way to have a table to the left or right of an image?

Yes, see TableAndImage

Uploads

When I upload a file, how do I make the link look like "file.doc" instead of "Attach:file.doc"?

Use parentheses, as in [[(Attach:)file.doc]]. There is also a configuration change that can eliminate the Attach: -- see Cookbook:AttachLinks.

Why can't I upload files of size more than 50kB to my newly installed PmWiki?

Out of the box PmWiki limits the size of files to be uploaded to 50kB. Add

$UploadMaxSize = 1000000; # limit upload file size to 1 megabyte
to your config.php to increase limit to 1MB (for example). See UploadsAdmin for how to further customize limits. Note that both PHP and webservers also place their own limits on the size of uploaded files.

Why does my upload exit unexpectedly with "Incomplete file received"?

You may be running out of space in a 'scratch' area, used either by PmWiki or by PHP. On *nix, check that you have sufficient free space in /tmp and /var/tmp.

How do I make it so that the upload link still allows one to make another upload (if someone wants to replace the old version of a file with a newer version, for example). Currently you only get the upload link when there is no file in the upload directory.

Use the Attach page action, and click on the delta symbol (Δ) shown against each of files listed. If you can't see the attach action either uploads are not enabled, you are not not authorised to upload, or the attach action has been commented out or is missing. See also available actions, and look at Test?action=upload.

How do I prevent files being uploaded with no extension?

Ho do I hide the "Attach:" for all attachments

See Cookbook:AttachLinks

How to avoid problems with non-ASCII characters in attachment names (i.e. "Zażółć geślą jaźń.doc")?

See $UploadNameChars = "-\w. !=+"#; # allow exclamations, equals, plus, and hash

How can I link a file that have a 4-letter file extension such like 'abc.pptx'? If I try to download it, its file extension changes automatically like 'abc.zip' ? What is problem do you think ?

How can I prevent others from using the url's of my images on their site

See Cookbook:Prevent Hotlinking Prevent hotlinking of uploaded files

Tables

How do I create a basic table?

Tables are created via use of the double pipe character: ||. Lines beginning with this markup denote rows in a table; within such lines the double-pipe is used to delimit cells. In the examples below a border is added for illustration (the default is no border).

Basic table
|| border=1 rules=rows frame=hsides
|| cell 1 || cell 2 || cell 3 ||
|| cell 1 || cell 2 || cell 3 ||
cell 1cell 2cell 3
cell 1cell 2cell 3

How do I create cell headers?

Header cells can be created by placing ! as the first character of a cell. Note that these are table headers, not headings, so it doesn't extend to !!, !!!, etc.

Table headers
|| border=1 rules=cols frame=vsides
||! cell 1 ||! cell 2 ||! cell 3 ||
|| cell 1  ||  cell 2 ||  cell 3 ||
cell 1cell 2cell 3
cell 1cell 2cell 3

How do I create an advanced table?

See table directives

My tables are by default centered. When I try to use '||align=left' they don't align left as expected.

You're probably using Firefox. Use ||style="margin-left:0px;" instead.

How can I specify the width of columns?

At present there isn't a way to do this using the basic markup. You need to use Table Directives.

How can I display a double pipe "||" in cell text using basic table markup?

Use &#124;&#124; to display || as a special characters.

How do I specify that a cell spans 2 or more rows in a simple table?

How do I lay out a simple table so that a later editor can see the scope of a rowspan?

How do I lay out a simple table so that a later editor can see the scope of a colspan?

See Cookbook:Rowspan in simple tables

Table directives

Can I define table headers using the table directive markup?

No, but you can with Cookbook:AdvancedTableDirectives. See Pm's reply to pending PITS:00535

Is it possible to do nested tables?

Yes, if you nest simple tables inside advanced tables. See also Cookbook:AdvancedTableDirectives.

Is it possible to add background images to tables and table cells?

Yes, see Cookbook:BackgroundImages.

Is it possible to have a collapsible table, that you can set by default to be deployed (as with the (:toc:) display) or retracted?

WikiStyles

Some of my colors aren't working! For example, %color=#AAAAAA% works, but %color=#AA3333% doesn't work. What's wrong?

Be sure to use lowercase letters for rgb hex colors, otherwise PmWiki may mistake the color value for a WikiWord.

What did I miss ?

This works like I want:

(:div style="font-style:italic":)
I want italic text here
(:divend:)

>>font-style:italic<<
I want italic text again, and you got
it!
>><<

I want italic text here

I want italic text again, and you got it!

(:div style="border:2px solid black":)
I want a black border around here
(:divend:)

I want a black border around here

But why does that not ? (quotes were missing)

>>border:'2px solid blue'<<
I wish I had a blue border around here.
>><<

I wish I had a blue border around here.

Which styles do work in angle brackets syntax and which do not ? It seems to me that several-words-as-a-value styles do not, but maybe it should be documented somewhere (it caused me a nice headache).

See also
  • PITS:00860 - Add min and max width and height, clear; to table, div, block, and style directives
  • PmWiki:Block Markup - This page covers all the block markup character combinations
  • PITS:00962 - Make >><< behave identically with other block formatting when style= is used

why is a color word not a class class, eg

(:div class="frame green"
style="font-size:smaller":)
This text should be small, green, and
surrounded by a frame
(:divend:)

This text should be small, green, and surrounded by a frame

why does this not work?

(:div class="blue rframe" style="font-size:smaller":)
This text should be small, blue, and surrounded by a right floated frame
(:divend:)

This text should be small, blue, and surrounded by a right floated frame

Because, confusingly, rframe is not a class.

(:div class="blue rfloat frame" style="font-size:smaller":)
This text should be small, blue, and surrounded by a right floated frame
(:divend:)

This text should be small, blue, and surrounded by a right floated frame

Is a wiki style a class

%define=bclass bgcolor=#ddddff
border="1px dotted green"%

(:table:)
(:cellnr bclass:) test one
(:cellnr class="bclass":) test two
(:cellnr:)%bclass% test three
(:cellnr:)
>>bclass<<
test four
>><<
(:cellnr:)
(:div class="bclass":)
test five
(:divend:)
(:tableend:)
test one
test two
test three

test four

test five

It would be helpful to provide more consistency.

%define=zclass block bgcolor=#ddddff
border="1px dotted green"%

(:table:)
(:cellnr zclass:) test one
(:cellnr class="zclass":) test two
(:cellnr:)%zclass% test three
(:cellnr:)
>>zclass<<
test four
>><<
(:cellnr:)
(:div class="zclass":)
test five
(:divend:)
(:tableend:)
test one
test two
test three

test four

test five

What happened to test 3?

Q Why does neither of these apply styles to the contents of the DIV?

(:div class='lfloat' font-size='smaller' color='blue' bgcolor='#eee'
clear='left' :)
{*$Name}
(:divend:)

(:div style="font-size:'smaller'; color:'blue'; background-color:'#eee';
float:left; clear:'left';" :)
{*$Name}
(:divend:)

FAQ

FAQ

... or these

%define=mytrail div font-size='smaller' background-color='#eee'
float='right' clear='right' %
(:div:)
%mytrail%{*$Name}
(:divend:)

(:div mytrail:)
{*$Name}
(:divend:)

FAQ

FAQ

AccessKeys

How can I change the keyboard shortcuts for editing and saving a page?

See Customizing access keys.

PageDirectives

Can I get (:redirect:) to return a "moved permanently" (HTTP 301) status code?

Use (:redirect PageName status=301:).

Is there any way to prevent the "redirected from" message from showing at the top of the target page when I use (:redirect:)?

There are several possibilities.

If you want to suppress the message in all cases

  • add $PageRedirectFmt = ''; to your local/config.php

If you want to suppress the message based on the destination/target of the redirect

If you want to suppress the message based on the origin/source of the redirect

  • add the following to your local/config.php
if (@$_GET['from']) {
  $group = PageVar($_GET['from'], '$Group');
  if ($group == 'SomeGroup') $PageRedirectFmt = '';
}
(In the above code example, you might replace SomeGroup with Profiles.)

An alternative is the include the other page rather than redirect.

There are two cookbook recipes that may assist

Is there any method for redirecting to the equivalent page in a different group, i.e. from BadGroup/thispage => GoodGroup/thispage using similar markup to (:redirect Goodgroup.{Name}:)?

(:redirect Goodgroup.{$Name}:) works if you want to put it in one page.
If you want it to work for the entire group, put (:redirect Goodgroup.{*$Name}:) into Badgroup.GroupHeader - however, that only works with pages that really exist in Goodgroup; if you visit a page in Badgroup without a corresponding page of the same name in Goodgroup, instead of being redirected to a nonexistant page, you get the redirect Directive at the top of the page.
With (:if exists Goodgroup.{*$Name}:)(:redirect Goodgroup.{*$Name}:)(:ifend:) in Badgroup.GroupHeader you get redirected to Goodgroup.Name if it exists, otherwise you get Badgroup.Name without the bit of code displayed.

IncludeOtherPages

What's the maximum number of includes that can exist in a page?

My site seems to stop including after 48 includes. ($MaxIncludes)

By default, PmWiki places a limit of 50 include directives for any given page, to prevent runaway infinite loops and other situations that might eat up server resources. The limit can be modified by the wiki administrator via the $MaxIncludes variable.

Are there any solutions to specify the amount of words to be included instead of lines?

My favorable solution would be to have something like (:include PageName#anchor words=30:), which would mean: include 30 words after the anchor #anchor. Is there any implementation of this?

Is there any way to include from a group of pages without specifying by exact name, e.g. between Anchor X and Y from all pages named IFClass-* ?

This can be achieved using page lists.

There appears to be a viewing issue when the included page contains the (:title:) directive.

Even when the included section does not include that part of the page which has the (:title:) directive within it, the page which includes the other page is given title of the included page when it is viewed. Page listing is not affected, only viewing, and the correct page name appears in list.Des October 02, 2008, at 07:38 AM

Page specific variables

Is there a variable like $LastModified, but which shows me the creation time?

No, but you can create one in config.php. For instance:

# add page variable {$PageCreationDate} in format yyyy-mm-dd
$FmtPV['$PageCreationDate'] = 'strftime("%Y-%m-%d", $page["ctime"])';

if you like the same format that you define in config.php with $TimeFmt use

 $FmtPV['$Created'] = "strftime(\$GLOBALS['TimeFmt'], \$page['ctime'])";

WikiGroup

How can I get rid of the 'Main' group in urls for pages pointing to Main?

See Cookbook:Get Rid Of Main.

How can I limit the creation of new groups?

See Cookbook:Limit Wiki Groups.

Why doesn't [[St. Giles and St. James]] work as a link? (It doesn't display anything.)

Because it contains periods, and destroys PmWiki's file structure, which saves pages as Group.PageName. Adding those periods disrupts this format. Links may only contain words. If you need a link precisely as shown, the page must be named eg StGilesAndStJames then you can use the (:title:) directive to have the page's title appear with periods (:title St. Giles and St. James:). (Although modern US and UK grammar now tend to drop the period to simplify style).

How can I delete a wiki group?

Normally you can't, as this requires an admin with server-side access to delete the file that makes up the group's RecentChanges page. But there is an option method of making it possible to delete RecentChanges pages from within the wiki if the admin enables the code found on Cookbook:RecentChanges Deletion.

How can I delete a wiki group's Group.RecentChanges page?

Normally you can't, as this requires an admin with server-side access to delete a file. But there is an optional method of making it possible to delete RecentChanges pages from within the wiki if the admin enables the code found on Cookbook:RecentChanges Deletion.

GroupHeaders

How do I set one header for all pages/groups?

The header for each page is controlled by the $GroupHeaderFmt variable. Thus a site-wide groupheader can be added with

$GroupHeaderFmt = '(:include {$SiteGroup}.SiteHeader
                   basepage={*$FullName}:)(:nl:)' . $GroupHeaderFmt;

Note that single quotes must be used so that $Group (which is part of the default contents of $GroupHeaderFmt) will be substituted properly by PmWiki, and that this applies to all variables ending in $...Fmt. See also the Cookbook:AllGroupHeader page.

Any form of markup is valid in $GroupHeaderFmt, thus one can do

$GroupHeaderFmt .= "Global markup text here.";

Would this then work for site footers?

$GroupFooterFmt = '(:include {$SiteGroup}.SiteFooter
                   basepage={*$FullName}:)(:nl:)' . $GroupFooterFmt;

Yes, I am using this in my config.php file for my footers and it works perfectly Ian MacGregor

WikiTrails

How can the trail be made to start at (or from) the "parent page"?

That is the first trail markup should be visible on the "parent page". In the example below the next and prev pages should show as (arbitrarily) the first and last pages on the trail (excluding any loop entry).

<|[[{PmWiki.WikiTrails$FullName}]]|>

PmWiki.WikiTrails

Why doesn't my trail show up?

Don't provide link text or title markup. (This is probably a bug for feature that needs a PITS. entry).

incorrect
<| [[PmWiki/Documentation index | +]]
|> 

<| [[PmWiki/Documentation index |
link text]] |> 

<| DocumentationIndex |>

<| link text |>

correct
<| [[PmWiki/Documentation index]]
|> 

Documentation index

PageHistory

Is there a way to remove page history from page files?

1. Administrators can clean page histories using the Cookbook:ExpireDiff recipe.

2. Administrators with FTP file access can download individual pages from the wiki.d directory, open them in a text editor, manually remove history, and re-upload the files to wiki.d/ directory. Care must be exercised, when manually editing a page file, to preserve the minimum required elements of the page and avoid corrupting its contents. See PageFileFormat#creating.

3. Edit the page. Select all the contents of the edit text area and cut them to the clipboard. Enter delete into the text area and click on the save and edit button. Select all the contents of the edit text area and paste the contents of the clipboard over them. Click on the save button. This will remove all of the page's history up to the final save in which the pasted material is re-added.

How can I restrict viewing the page history (?action=diff) to people with edit permission?

In the local/config.php file, set

$HandleAuth['diff'] = 'edit';

Passwords

How can I password protect all the pages and groups on my site? Do I really have to set passwords page by page, or group by group?

Administrators can set passwords for the entire site by editing the config.php file; they don't have to set passwords for each page or group. For example, to set the entire site to be editable only by those who know an "edit" password, an administrator can add a line like the following to local/config.php:

    $DefaultPasswords['edit'] = crypt('edit_password');

For more information about the password options that are available only to administrators, see PasswordsAdmin.

I get http error 500 "Internal Server Error" when I try to log in. What's wrong?

This can happen if the encrypted passwords are not created on the web server that hosts the PmWiki.
The crypt function changed during the PHP development, e.g. a password encrypted with PHP 5.2 can not be decrypted in PHP 5.1, but PHP 5.2 can decrypt passwords created by PHP 5.1.
This situation normally happens if you prepare everything on your local machine with the latest PHP version and you upload the passwords to a webserver which is running an older version.
The same error occurs when you add encrypted passwords to local/config.php.

Solution: Create the passwords on the system with the oldest PHP version and use them on all other systems.

How can I create private groups for users, so that each user can edit pages in their group, but no one else (other than the admin) can?

Administrators can use the AuthUser recipe and add the following few lines to their local/config.php file to set this up:

    $group = FmtPageName('$Group', $pagename); 
$DefaultPasswords['edit'] = 'id:'.$group;
include_once("$FarmD/scripts/authuser.php");

This automatically gives edit rights to a group to every user who has the same user name as the group name.

How come when I switch to another wiki within a farm, I keep my same authorization?

PmWiki uses PHP sessions to keep track of authentication/authorization information, and by default PHP sets things up such that all interactions with the same server are considered part of the same session.

An easy way to fix this is to make sure each wiki is using a different cookie name for its session identifier. Near the top of one of the wiki's local/config.php files, before calling authuser or any other recipes, add a line like:

    session_name('XYZSESSID');

You can pick any alphanumeric name for XYZSESSID; for example, for the cs559-1 wiki you might choose

    session_name('CS559SESSID');

This will keep the two wikis' sessions independent of each other.

What to do if wiki-sessions do not work? I tried the solution above; and the browser get the sessions. But still I can use authorisation of one wiki for another wiki...

Are passwords sent in the clear? What is the method by which passwords are encrypted and transmitted?

PageLists

How can I configure my site to always exclude wiki-related pages from searches?

Try the following in your local/config.php file. See also Cookbook:SearchPatterns.

## Exclude Certain pages / groups from search results.
$SearchPatterns['default'][] = '!\\.(All)?Recent(Changes|Uploads|Comments)$!';
$SearchPatterns['default'][] = '!\\.Group(Print)?(Header|Footer|Attributes)$!';
$SearchPatterns['default'][] = '!\\.(Left|Right|Side)(Bar|Menu|Note)$!';
$SearchPatterns['default'][] = '!^Site\\.!';
$SearchPatterns['default'][] = '!^PmWiki\\.!';

If you add $SearchPatterns['default']... to exclude groups and pages from pagelist and search output, you can include the omitted pages by using "list=all" in the pagelist or search parameters.

How do I turn on wiki word spacing in page lists?

Try the following in your Site.LocalTemplates

----
!!!fmt=#simplelist

Simple list of page names, without the Group name. 

[@
[[#simplelist]]
[[({=$Group}/){=$Name}|{=$Titlespaced}]],
[[#simplelistend]]

@]

Can I customise the text in the button generated by the (:searchbox:) directive?

The searchbox directive does not appear to support a parameter to change the label of the associated submit button.

How to list only pages that have their title (*not* name) starting with A, B, C,...

(:pagelist $Title=A*,B*,C* :)

How do I search for pages changed by an particular author?

It would be useful to provide Author= (similar to name= or group=).

Try using the AuthorContribution recipe.

This recipe provides a way to automatically keep a list of the pages each author has edited by producing an "Author Contributions" page with a name of Profiles.<author's name>-Contrib for each author that has a page in the Profiles group.

Contributions by authors without profile pages are placed in a single Profiles.Other-Contrib page.

You may try listpage using $LastModifiedBy variable, as in : (:pagelist / list=normal group=-PmWiki $LastModifiedBy=-X:) or (:pagelist / list=normal group=-PmWiki $LastModifiedBy=X:) to print the list of pages last edited by all but X or edited by x (Petko's pagelist).

How do I search for pages changed after a particular date?

...

How to exclude deleted pages from (:pagelist trail=Site.AllRecentChanges fmt=#title count=15 order=-time :)

Use (:pagelist trail=Site.AllRecentChanges if="exists {=$FullName}" ...:) --Petko (This needs the new beta version in order to work, the latest stable will ignore the if= condition.)

Using pagelist with the link-parameter causes on Strato an "Internal Server Error:"

"The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, service@webmailer.de and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log."
The same thing happens when trying to search something or when trying to load the PmWikiDe/DocumentationIndex page. Are there ideas for a workaround?

I had a similar error on Free.fr due to a local misconfiguration of PHP4. Switching the website to PHP5 solved the issue. As Strato supports different versions of PHP4 and 5, you should try all and tell us if/when it works. (Read the FAQs: you need to rename your index.php to index.php5, or add in your /.htaccess the code: "AddType application/x-httpd-php5 .php"). --Petko February 16, 2008, at 08:35 PM

order=ctime displays the pages in the order they were created. Is there a way to reverse this (so that the newest page appears first)?

Yes. Use order=-ctime (note the "minus").

A pagelist excludes the current page from the generated list if "list=normal", how can the current page be included while retaining all the other benefits of using "list=normal"?

Set in config.php this: $SearchPatterns['normal']['self'] = ""; If you want to be able to use both behaviors, set this in config.php:

  $SearchPatterns['normalself'] = array(
  'recent' => '!\.(All)?Recent(Changes|Uploads)$!',
  'group' => '!\.Group(Print)?(Header|Footer|Attributes)$!');

Then use list=normalself on pages that should include themselves in the results.

Is it possible to return a list of all pages that are not protected by the sitepassword?

Experimenting with the "passwd="-attribute didn't get me very far...

Perhaps Cookbook:AuthListShort might help.

How do I capture the output from "fmt=count" into a page text variable?

I want to test if the pagelist returns any items, or to separate the pagelist into two columns.

Category: Searching

PageDirectives

Can I get (:redirect:) to return a "moved permanently" (HTTP 301) status code?

Use (:redirect PageName status=301:).

Is there any way to prevent the "redirected from" message from showing at the top of the target page when I use (:redirect:)?

There are several possibilities.

If you want to suppress the message in all cases

  • add $PageRedirectFmt = ''; to your local/config.php

If you want to suppress the message based on the destination/target of the redirect

If you want to suppress the message based on the origin/source of the redirect

  • add the following to your local/config.php
if (@$_GET['from']) {
  $group = PageVar($_GET['from'], '$Group');
  if ($group == 'SomeGroup') $PageRedirectFmt = '';
}
(In the above code example, you might replace SomeGroup with Profiles.)

An alternative is the include the other page rather than redirect.

There are two cookbook recipes that may assist

Is there any method for redirecting to the equivalent page in a different group, i.e. from BadGroup/thispage => GoodGroup/thispage using similar markup to (:redirect Goodgroup.{Name}:)?

(:redirect Goodgroup.{$Name}:) works if you want to put it in one page.
If you want it to work for the entire group, put (:redirect Goodgroup.{*$Name}:) into Badgroup.GroupHeader - however, that only works with pages that really exist in Goodgroup; if you visit a page in Badgroup without a corresponding page of the same name in Goodgroup, instead of being redirected to a nonexistant page, you get the redirect Directive at the top of the page.
With (:if exists Goodgroup.{*$Name}:)(:redirect Goodgroup.{*$Name}:)(:ifend:) in Badgroup.GroupHeader you get redirected to Goodgroup.Name if it exists, otherwise you get Badgroup.Name without the bit of code displayed.

DeletingPages

Deleting Wiki Groups & Categories: Once I create a Group or Category, how can I get rid of that group or category?

An admin can just remove the unwanted pages from wiki.d/ . Normally, doing it via the wiki doesn't resolve the problem, since it counts as an "update" which causes the Recent Changes page to be re-created, but it is possible to modify the site's configuration to allow deletion of the group's RecentChanges page -- see Cookbook:RecentChangesDeletion.

PmWiki Installation

Should I rename pmwiki.php to index.php?

Renaming pmwiki.php is not recommended. Instead, create an index.php file that contains this single line

<?php include_once('pmwiki.php');

How do I make pmwiki.php the default page for a website?

Create an index.php file that runs PmWiki from a subdirectory (pmwiki/ for example) and place it in the site's web document root (the main directory for the website).

<?php chdir('pmwiki'); include_once('pmwiki.php');

Note: You will also need to explicitly set the $PubDirUrl variable (e.g. to "http://example.com/pmwiki/pub") in local/config.php .

How do I enable "Clean URLs" that are shorter and look like paths to my wiki pages? Why does pmwiki.org appear to have a directory structure rather than "?n=pagename" in URLs?

See Cookbook:CleanUrls.

Is it possible to move wiki.d to /tmp/persistent/foo/wiki.d (a new sourceforge rule)?

Sourceforge suggests moving everything to /tmp/persistent/new-folder-of-your-choice/ and creating a symbolic link to the new folder on /tmp . It works -- see Cookbook:SourceForgeServers.

How can I run PmWiki on a standalone (offline, portable) machine ?

See Cookbook:Standalone or Cookbook:WikiOnAStick.

Upgrades

How can I determine what version of PmWiki I'm running now?

See version - Determining and displaying the current version of PmWiki (pmwiki-2.2.0-beta68).

How can I test a new version of PmWiki on my wiki without changing the prior version used by visitors?

The easy way to do this is to install the new version in a separate directory, and for the new version set (in local/config.php):


    $WikiLibDirs = array(&$WikiDir,
      new PageStore('/path/to/existing/wiki.d/{$FullName}'),
      new PageStore('wikilib.d/{$FullName}'));

This lets you test the new version using existing page content without impacting the existing site or risking modification of the pages. (Of course, any recipes or local customizations have to be installed in the new version as well.)

Then, once you're comfortable that the new version seems to work as well as the old, it's safe to upgrade the old version (and one knows of any configuration or page changes that need to be made).

Uploads Administration

How do I disable uploading of a certain type of file?

Here's an example of what to add to your local/config.php file to disable uploading of .zip files:

$UploadExtSize['zip'] = 0; # Disallow uploading .zip files.

How do I attach uploads to individual pages or the entire site, instead of organizing them by wiki group?

Use the $UploadPrefixFmt variable (see also the Cookbook:UploadGroups recipe).

$UploadPrefixFmt = '/$FullName'; # per-page
$UploadPrefixFmt = ''; # site-wide

For $UploadDirQuota - can you provide some units and numbers? Is the specification in bytes or bits? What is the number for 100K? 1 Meg? 1 Gig? 1 Terabyte? GNUZoo

Units are in bytes.

   $UploadDirQuota = 100*1024;         # limit uploads to 100KB
   $UploadDirQuota = 1000*1024;        # limit uploads to 1000KB
   $UploadDirQuota = 1024*1024;        # limit uploads to 1MB
   $UploadDirQuota = 25*1024*1024;     # limit uploads to 25MB
   $UploadDirQuota = 2*1024*1024*1024; # limit uploads to 2GB

Is it possible to eliminate the "Name attachment as:" box so the uploaded file uses the same filename and the selected file? GNUZoo

Yes. Put the following code into you config.php file:

$PageUploadFmt = array("
  <div id='wikiupload'>
  <h2 class='wikiaction'>$[Attachments for] {\$FullName}</h2>
  <h3>\$UploadResult</h3>
  <form enctype='multipart/form-data' action='{\$PageUrl}'
method='post'>
  <input type='hidden' name='n' value='{\$FullName}' />
  <input type='hidden' name='action' value='postupload' />
  <table border='0'>
    <tr><td align='right'>$[File to upload:]</td><td><input
      name='uploadfile' type='file' /><input type='submit'
value='Upload' /></td></tr></table></form></div>",
  'wiki:$[{$SiteGroup}/UploadQuickReference]');

Is there a way to allow file names with Unicode or addtiional characters?

Yes, see $UploadNameChars

Where is the list of attachments stored? JanBrejcha

It is generated on the fly by the (:attachlist:) markup.

In my lan-only pmwiki, how can I authorize ANY upload, without any size nor type checking? At the moment, I force my lan-only fully-trusted users to use a container such as .tar... Mhhh... Not that nice.

How can I find orphaned or missing attachments

See Cookbook:Attachlist enhanced How to list missing or orphaned attachments.

How can I prevent hotlinking of my uploaded images

See Cookbook:Prevent Hotlinking Prevent hotlinking of uploaded files

How do I disable the upload file files with no extension?

in my config.ini (2.2.0-beta67) i have limited the max upload size to 8 Mb

# turns off all upload extensions
$UploadMaxSize = 0;

$aSize=8*1000*1000;       # limit all files to 8MB
$UploadExtSize['gif'] = $aSize;      
$UploadExtSize['jpg'] = $aSize;       
$UploadExtSize['doc'] = $aSize;      
$UploadExtSize['xls'] = $aSize;       
$UploadExtSize['xlt'] = $aSize; 

trying to upload a 2,25 Mb file i get the message "filesize too big", the upload works fine with the older 1,99 Mb version of the same file. Has somebody any suggestions what the problem could be? Alexander D?

Check your php.ini for upload_max_filesize

upload_max_filesize = 8M

Security

How do I report a possible security vulnerability of PmWiki?

Pm wrote about this in a post to pmwiki-users from September 2006. In a nutshell he differentiates two cases:

  1. The possible vulnerability isn't already known publicly: In this case please contact Pm by private mail.
  2. The possible vulnerability is already known publicly: In this case feel free to discuss the vulnerability in public (e.g. on pmwiki-users).

See his post mentioned above for details and rationals.

What about the botnet security advisory at http://isc.sans.org/diary.php?storyid=1672?

Sites that are running with PHP's register_globals setting set to "On" and versions of PmWiki prior to 2.1.21 may be vulnerable to a botnet exploit that is taking advantage of a bug in PHP. The vulnerability can be closed by turning register_globals off, upgrading to PmWiki 2.1.21 or later, or upgrading to PHP versions 4.4.3 or 5.1.4.
In addition, there is a test at PmWiki:SiteAnalyzer that can be used to determine if your site is vulnerable.

Wiki Vandalism

Assumptions
you are using a Blocklist and Url approvals.
You don't want to resort to password protecting the entire wiki, that's not the point after all.
Ideally these protections will be invoked in config.php

how do I stop pages being deleted, eg password protect a page from deletion?

use Cookbook:DeleteAction and password protect the page deletion action? by adding $DefaultPasswords['delete'] = '*'; to config.php or password protect the action with $HandleAuth['delete'] = 'edit';

or $HandleAuth['delete'] = 'admin'; to require the edit or admin password respectively.

how do I stop pages being replaced with an empty (all spaces) page?

Add block: /^\s*$/ to your blocklist.

how do I stop pages being completely replaced by an inane comment such as excellent site, great information, where the content cannot be blocked?

Try using the newer automatic blocklists that pool information and IP addresses about known wiki defacers. or Try using Cookbook:Captchas Uses captchas to protect certain actions from spambots or Cookbook:Captcha Use captchas to prevent automated systems from modifying pages, (note these are different} or Set an edit password, but make it publicly available on the Site.AuthForm template.

how do I password protect all common pages in all groups such as recent changes, search, group header, group footer, and so on?

insert the following lines into your local/config.php file. Editing these pages then requires the admin password.

## Require admin password to edit RecentChanges (etc.) pages.
if ($action=='edit'
    && preg_match('/\\.(Search|Group(Header|Footer)|(All)?RecentChanges)$/', $pagename))
  { $DefaultPasswords['edit'] = crypt('secret&nbsp;phrase'); }

Note that all GroupAttributes pages are protected by the attr password.

Alternative: I think because of my clean URLs setup I had to shorten the regular expression a little to make it work. furthermore I set the edit password for these pages to the admin password set in $DefaultPasswords['admin'] = crypt('secret phrase'); in local/config.php file:

## Require admin password to edit RecentChanges (etc.) pages.
if ($action=='edit' 
    && preg_match('(Search|Group(Header|Footer)|(All)?RecentChanges)', $pagename))
  { $HandleAuth['edit'] = 'admin'; }

As far as I could see in my tests this seems to work for me as expected. --Rico, 2007-02-02

how do I password protect the creation of new groups?

see Cookbook:Limit Wiki Groups How to limit the names or number of groups in your wiki

how do I password protect the creation of new pages?

see Cookbook:Limit new pages in Wiki Groups How to limit the creation of new pages in your wiki group

how do I take a whitelist approach where users from known or trusted IP addresses can edit, and others require a password?

Put these lines to local/config.php:

## Allow passwordless editing from own turf, pass for others.
if ($action=='edit'
 && !preg_match("^90.68.", $_SERVER['REMOTE_ADDR']) )    
 { $DefaultPasswords['edit'] = crypt('foobar'); }

Replace 90.68. with the preferred network prefix and foobar with the default password for others.

how do I, in config.php, add, or remove, an edit password for a group (or single page)?

?

how do I password protect page actions?

see Passwords for setting in config.php

$DefaultPasswords['pageactionname'] = crypt('secret phrase');

or

$HandleAuth['pageactionname'] = 'anotherpageactionname';

How do I only allow authors to post if they have a Profile?

Add this to your local/config.php below include_once("$FarmD/scripts/author.php"); line:

if(!PageExists('Profiles.'.$Author)&&$action=='edit')
$HandleAuth['edit'] = 'admin';

This is a possible solution, but be warned: author can't edit their wiki page in Profiles? group too. Add if($group!='Profiles') above ;-)

How to make a rule that allows only authors to edit their own wiki page in Profiles? group?

Add this to your local/config.php

$name = PageVar($pagename, '$Name');
if($group=='Profiles') $DefaultPasswords['edit'] = 'id:'.$name;

How do I moderate all postings?

Enable PmWiki.Drafts

  • Set $EnableDrafts, this relabels the "Save" button to "Publish" and a "Save draft" button appears.
  • Set $EnablePublish, this adds a new "publish" authorization level to distinguish editing from publishing.

How do I make a read only wiki?

In config.php set an "edit" password.

Custom InterMap

Are InterMap names case sensitive?

Yes, thus eAdmin: is a different InterMap link than EAdmin:.

How can I achieve a localmap.txt mapping with the effect of Pics: Path:/somepathto/pics/?

Use the following:

Pics: /somepathto/pics/

Is there any chance to get the InterMap part of the class selector of the resulting Link? Means Wikipedia:Example gets <a href="..." class="wikipedia"> - automatically without writing a special LinkIMap entry for every InterMap entry?

CustomMarkup

How can I embed JavaScript into a page's output?

There are several ways to do this. The Cookbook:JavaScript recipe describes a simple means for embedding static JavaScript into web pages using custom markup. For editing JavaScript directly in wiki pages (which can pose various security risks), see the JavaScript-Editable recipe. For JavaScript that is to appear in headers or footers of pages, the skin template can be modified directly, or <script> statements can be inserted using the $HTMLHeaderFmt array.

How would I create a markup ((:nodiscussion:)) that will set a page variable ({$HideDiscussion}) which can be used by (:if enabled HideDiscussion:) in .PageActions? ejersau? May 07, 2007, at 06:27 PM

Add the following section of code to your config.php

SDV($HideDiscussion, 0); 	#define var name
Markup('hideDiscussion', '<{$var}', '/\\(:nodiscussion:\\)/e', 'setHideDiscussion(true)'); 
function setHideDiscussion($val) { 
  global $HideDiscussion; 
  $HideDiscussion = $val;
} 

This will enable the (:if enabled HideDiscussion:) markup to be used. If you want to print the current value of {$HideDiscussion} (for testing purposes) on the page, you'll also need to add the line:
$FmtPV['$HideDiscussion'] = '$GLOBALS["HideDiscussion"]';

PmWiki only supports tool tips for external links, can I use custom markup to add tool tips to internal links?

Yes, add the following custom markup to your config.php:
Markup('%title%', 'inline', '/%title%(.*?)"(.*?)"(.*?)%%/', '<span title="$2">$1$3</span>'); # Add tool tips to internal links, Example: %title%[[link"tool tip"]]%%

Use the markup with internal links such as:
%title%[[CookBook "cool" | Example]]%%

(jtankers) August 22, 2007

I'm trying to create a markup that takes arbitrary text and stores it in a custom page variable so that variable can be accessed later through the page variable markup (I'm using version 2.1.27). Thus far, I have this line in my config file: Markup('authors', '_begin', "/\\(:authors\\s+(.+?):\\)/ei", "PZZ(\$GLOBALS['FmtPV']['\$Authors'] = '$1')"). It works reasonably well except that it doesn't match text with spaces in it. For example, I can access the variable correctly if use (:authors Tyrel:) but not with (:authors Tyrel Newton:). Where am I going wrong? tyrel Oct 25, 2007

It appears that (.*?) does not match newlines in these functions, making the above example inoperable if the text to be wrappen in <em> contains new lines.

If you include the "s" modifier on the regular expression then the dot (.) will match newlines. Thus your regular expression will be "/STUFF(.*?)/s". That s at the very end is what you are looking for. If you start getting into multi-line regexes you may be forced to look at the m option as well - let's anchors (^ and $) match not begin/end of strings but also begin/end of lines (i.e., right before/after a newline).

See also Cookbook:LinkTitles

How do I get started writing recipes and creating my own custom markup?

(alternate) Introduction to custom markup for Beginners

Internationalizations

If my wiki is internationalized by config.php, how do I revert a specific group to English?

Use $XLLangs = array('en'); in the group's per group customization file.

If my wiki is in English and I want just one page, or group, in Spanish do I say XLPage('es','PmWikiEs.XLPage'); in the group or page configuration file?

Yes, that is usually the best method. If you were doing this with many scattered pages, or with several languages, you might find it easier to maintain if you load the translations all in config.php like this:

   XLPage('es','PmWikiEs.XLPage');
   XLPage('fr','PmWikiFr.XLPage');
   XLPage('ru','PmWikiRu.XLPage');
   $XLLangs = array('en');

Then in each group or page configuration file, you'd just use $XLLangs = array('es'); to set the language to use (in this case, Spanish). Note that though this method is easier to maintain, its somewhat slower because it loads all the dictionaries for each page view, even if they won't be used.

What does the first parameter of this function stand for? How can it be used?

The XLPage mechanism allows multiple sets of translations to be loaded, and the first parameter is used to distinguish them.

For example, suppose I want to have translations for both normal French and "Canadian" French. Rather than maintain two entirely separate sets of pages, I could do:

    XLPage('fr', 'PmWikiFr.XLPage');
    XLPage('fr-ca', 'PmWikiFrCa.XLPage');

PmWikiFr.XLPage would contain all of the standard French translations, while PmWikiFrCA.XLPage would only need to contain "Canada-specific" translations -- i.e., those that are different from the ones in the French page.

The first parameter distinguishes the two sets of translations. In addition, a config.php script can use the $XLLangs variable to adjust the order of translation, so if there was a group or page where I only wanted the standard French translation, I can set

    $XLLangs = array('fr', 'en');

and PmWiki will use only the 'fr' and 'en' translations (in that order), no matter how many translations have been loaded with XLPage().

Tools for PmWiki Localization

You can help to localize PmWiki in your language in the original site:

Translation Portal I think it may be of some use to have a central page devoted to translation (aimed to translators) - the present page is for i18n by users. the translation portal is a central hub for translators as starting point jdd Unfortunately, an anonymous contributor have deleted on march,16 the link to the localization page, so it have disappeared in space. It was intended to be the resource you are searching for. I think these two pages shall be merged somewhat. The same contributor also have made an energic cleaning of the Internationalization page and the pertinence of all that erasing shall be carefully checked.PRZ

feel free to restore it!

The creation of a "localization" group is a very good idea (I'm too new here to take such decision :-), but I think keeping at least one page aimed to translators in the PmWiki group is a good idea, must simpler to find, I guess. the other translator pages should be moved to the new group. jdd

Multilingual pmWiki-based website, is it possible? Would it be possible to set pmwiki in a way that allows to maintain a multilingual website? I realize when you discuss i10n and l18n you refer to the wiki system itself, but on the content level it may be more than desirable, especially if the user may select his/her desired language for the content. VirtualFlavius?

Might be possible and actually sort of a common feature. (A heavy-weight CMS I know offers several language instances of the same page "seamlessly" - which is different from the Wikipedia, where you have to actively change the Wikipedia instance.) Have you had a look at the PITS yet to see if someone already made a feature request for this? --Henning June 25, 2007, at 09:55 AM
I've had some success using (and extending) the SubgroupMarkup recipe for multilingual websites. This allows me to create different language instances of a page by appending a language code as a subgroup. For example, "Main/Homepage,EN" would refer to the English version of "Main/Homepage", "Main/Homepage,FR" would contain the French version, and so on. --gh? December 3, 2007

LocalCustomizations

Can I change the default page something other than Main.HomePage ($DefaultPage)?

Yes, just set the $DefaultPage variable to the name of the page you want to be the default. You might also look at the $DefaultGroup and $DefaultName configuration variables.

$DefaultPage = 'ABC.StartPage';

How do I get the group / page name in a local configuration file (e.g. local/config.php)?

Use the following markup in pmwiki-2.1.beta21 or newer:

## Get the group and page name
$pagename = ResolvePageName($pagename);
$page = PageVar($pagename, '$FullName');
$group = PageVar($pagename, '$Group');
$name = PageVar($pagename, '$Name');

Can I remove items from the wikilib.d folder on my site?

Yes, the files in wikilib.d/ can be safely removed. They'll reappear again when you upgrade, however.

How do I customize my own 404 error page for non-existent pages?

To change the text of the message, try editing the Site.PageNotFound page.

PerGroupCustomizations

How can I apply CSS styles to a particular group or page?

Simply create a pub/css/Group.css or pub/css/Group.Page.css file containing the custom CSS styles for that group or page.

Why shouldn't passwords be set in group (or page) customization files?

The reason for this advice is that per-group customization files are only loaded for the current page. So, if $DefaultPasswords['read'] is set in local/GroupA.php, then someone could use a page in another group to view the contents of pages in GroupA. For example, Main.WikiSandbox could contain:

(:include GroupA.SomePage:)

and because the GroupA.php file wasn't loaded (we're looking at Main.WikiSandbox --> local/Main.php), there's no read password set.

The same is true for page customization files.

Isn't that processing order strange? Why not load per page configuration last (that is after global configuration an per group configuration)?

Many times what we want to do is to enable a certain capability for a group of pages, but disable it on a specific page, as if it was never enabled. If the per-group config file is processed first, then it becomes very difficult/tedious for the per-page one to "undo" the effects of the per-group page. So, we load the per-page file before the per-group.

If a per-page customization wants the per-group customizations to be performed first, it can use the techniques given in PmWiki.PerGroupCustomizations (using include_once() or setting $EnablePGCust = 0).

Skins

How do I change the Wiki's default name in the upper left corner of the Main Page?

Put the following config.php

$WikiTitle = 'My Wiki Site';

The docs/sample-config.php file has an example of changing the title.

How can I embed PmWiki pages inside a web page?

Source them through a PHP page, or place them in a frame.

How do I change the font or background color of the hints block on the Edit Page?

Add a CSS style to pub/css/local.css: .quickref {background:...; color:... }. The hints are provided by the Site.EditQuickReference page, which is in the PmWiki or Site wikigroup. Edit that page, and change the "bgcolor" or specify the font "color" to get the contrast you need.

SkinTemplates

How do I customize the CSS styling of my PmWiki layout?

See Skins for how to change the default PmWiki skin. See also Cookbook:Skins, where you will find pre-made templates you can use to customize the appearance of your site. You can also create a file called local.css in the pub/css/ directory and add CSS selectors there (this file gets automatically loaded if it exists). Or, styles can be added directly into a local customization file by using something like:

$HTMLStylesFmt[] = '.foo { color:blue; }';

Where can the mentioned "translation table" be found for adding translated phrases?

See Internationalizations.

How to properly use the <!--file:path/somefile.php--> in order to be able to php include a file that is hosted outside the pmwiki directory.

I want my template to have a php include to my site's footer php file so that it can be dynamic. Thank you.

You have to keep your php file where your pmwiki.php file is, so it can be automatically included or use the full path to your file with the "file:" skin directive.

How can I insert javascript in the skin template ?

When I try to do so, it seems that the Javascript is turned off. I'm missing something but I'm an amateur.

I've the same problem. Somebody please tell us something about, thanks.

For that matter is there any sort of programming language you can use in a template file?

Earlier I wrote some javascript to check if the page was being edited, and if so not display a sidebar, but ran into the problem above me. Are these files parsed with PHP? Or is there a way to use those embedded HTML comments mentioned in the article to accomplish what I mentioned?

If the sidebar is marked with <!--PageLeftFmt-->, adding (:noleft:) to Site.EditForm will hide it when a page is edited.

WebFeeds

How do I include text from the page (whole page, or first X characters) in the feed body? (note: markup NOT digested)

    function MarkupExcerpt($pagename) {
      $page = RetrieveAuthPage($pagename, 'read', false);
      return substr(@$page['text'], 0, 200);
    }

    $FmtPV['$MarkupExcerpt'] = 'MarkupExcerpt($pn)';
    $FeedFmt['rss']['item']['description'] = '$MarkupExcerpt';

Q:Does this mean if I want to include the time in the rss title and "summary" to rss body I call $FeedFmt twice like so:

$FeedFmt['rss']['item']['description'] = '$LastSummary'; 
$FeedFmt['rss']['item']['title'] = '{$Group} / {$Title} @ $ItemISOTime';
From mailing list Feb 13,2007, a response by Pm: Yes

What if I want the text included to be marked up to HTML?

From mailing list June 26, 2007, by Roman:

  $FeedFmt['rss']['item']['description'] = 'FeedText';

  function FeedText($pagename, &$page, $tag) {
    $p = ReadPage($pagename);
    $content = MarkupToHTML($pagename, $p['text']);
    return "<$tag><![CDATA[$content]]></$tag>";
  }

How do I include the last change (the last diff section) in the feed body ? I would like to see directly what has

been modified.

How can I use the RSS <enclosure> tag for podcasting?

For podcasting of mp3 files, simply attach an mp3 file to the page with the same name as the page (i.e., for a page named Podcast.Episode4, one would attach to that page a file named "Episode4.mp3"). The file is automatically picked up by ?action=rss and used as an enclosure.

The set of potential enclosures is given by the $RSSEnclosureFmt array, thus

$RSSEnclosureFmt = array('{$Name}.mp3', '{$Name}.wma', '{$Name}.ogg');

allows podcasting in mp3, wma, and ogg formats.

How to add "summary" to the title in a rss feed (ie. with ?action=rss)?

Add this line in you local/config.php

$FeedFmt['rss']['item']['title'] = '{$Group} / {$Title} : $LastModifiedSummary';

How to add "description" to the title in an rss feed, and summary to the body?

Add these lines to your local/config.php

$FeedFmt['rss']['item']['title'] = '{$Group} / {$Title} : {$Description}';
$FeedFmt['rss']['item']['description'] = '$LastModifiedSummary';
-OtherMichael, based on the "summary" example, above

NOTES:

  • you need to replicate these lines for each type (eg, atom, rdf, dc) of feed you provide.
  • the Rss description-tag is not equivalent to the pmWiki $Description variable, despite the confusing similarity.

Some of my password-protected pages aren't appearing in the feed... how do I work around this?

From a similar question on the newsgroup, Pm's reply:

The last time I checked, RSS and other syndication protocols didn't really have a well-established interface or mechanism for performing access control (i.e., authentication). As far as I know this is still the case.

PmWiki's WebFeeds capability is built on top of pagelists, so it could simply be that the $EnablePageListProtect option is preventing the updated pages from appearing in the feed. You might try setting $EnablePageListProtect=0; and see if the password-protected pages start appearing in the RSS feed.

The "downside" to setting $EnablePageListProtect to zero is that anyone doing a search on your site will see the existence of the pages in the locked section. They won't be able to read any of them, but they'll know they are there!

You could also set $EnablePageListProtect to zero only if ?action=rss:

    if ($action == 'rss') $EnablePageListProtect = 0;
This worked well for me. Sandy

This limits the ability to see the protected pages to RSS feeds; normal pagelists and searches wouldn't see them.

Lastly, it's also possible to configure the webfeeds to obtain the authentication information from the url directly, as in:

    .../Site/AllRecentChanges?action=rss&authpw=secret

The big downside to this is that the cleartext password will end up travelling across the net with every RSS request, and may end up being recorded in Apache's access logs.

How to add feed image?

Add the following to local/config.php (this example is for ?action=rss):

$FeedFmt['rss']['feed']['image'] =
" <title>Logo title</title>
 <link>http://example.com/</link>
 <url>http://example.com/images/logo.gif</url>
 <width>120</width>
 <height>60</height>";
Do not forget NOT to start with a '<' as there would be no <image> tag around this... See here.

How do I insert RSS news feeds into PmWiki pages?

See Cookbook:RssFeedDisplay.

How can I specify default feed options in a configuration file instead of always placing them in the url?

For example, if you want ?action=rss to default to ?action=rss&group=News&order=-time&count=10, try the following in a local customization file:

   if ($action == 'rss')
     SDVA($_REQUEST, array(
       'group' => 'News',
       'order' => '-time',
       'count' => 10));

Are there ways to let people easily subscribe to a feed?

The copy/paste urls method does work, but for some online reader there is a simpler way: Google is nice in that it lets you automatically subscribe to its Google Reader service if you are logged in, otherwise it creates a customized widget on an iGoogle page.
You can provide direct links like the following:

www.google.com/ig/add?feedurl=http://pmwiki.org/wiki/Site/AllRecentChanges?action=rss
add.my.yahoo.com/content?lg=it&url=http://pmwiki.org/wiki/Site/AllRecentChanges?action=rss
www.netvibes.com/subscribe.php?url=http://pmwiki.org/wiki/Site/AllRecentChanges?action=rss
www.wikio.com/subscribe?url=http%3A%2F%2Fpmwiki.org%2Fwiki/Site%2FAllRecentChanges?action=rss

Luigi

FAQ

Introduction

What is PmWiki?

PmWiki/PmWiki lines=2..16

What can I do with it?

PmWiki pages look and act like normal web pages, except they have an "Edit" link that makes it easy to modify existing pages and add new pages into the website, using basic editing rules. You do not need to know or use any HTML or CSS. Page editing can be left open to the public or restricted to small groups of authors. Feel free to experiment with the Text Formatting Rules in the "Wiki sandbox". The website you're currently viewing is built and maintained with PmWiki.

What are the requirements?

See the PmWiki requirements page.

Where can I find documentation?

See the documentation index page.

How can I download PmWiki?

See the download page.

How do I install PmWiki?

Instructions for installation are on the installation page.

How do I get help with PmWiki?

See How to get assistance

Basic PmWiki editing rules

I'm new to PmWiki, where can I find some basic help for getting started?

The Basic Editing page is a good start. From there, you can just follow the navigational links at the bottom of the page (they are called Wiki Trails) to the next pages, or to the Documentation Index page, which provides an outline style index of essential documentation pages, organized from basic to advanced.

How do I include special characters on my wiki pages?

Use character codes to insert special characters, such as Copyright (©) and Trademark (® or ™) symbols, that don't appear on your keyboard.

Why are separate lines of text in the markup combined into a single line on output?

PmWiki normally treats consecutive lines of text as being a paragraph, and merges and wraps lines together on output.