Basic PmWiki editing rules
(:pagelist group=PmWiki fmt=#test1 count=20:) [@ [[#test1]] >>frame<< !! {$$PageCount} {=$FullName} >><< (:include {=$FullName} lines=2..:) [[#test1end]] [[#test2]] # {=$FullName} [[#test2end]] @] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Access keys (See also Wikipedia:access keys) are keyboard shortcuts for tasks that would otherwise require a mouse click. They are part of markup that may exist on any webpage. On PmWiki steps have been taken to make it easier to use access keys throughout a site, and to make it possible to adjust key assignments to accommodate different languages and preferences. Using access keys in different operating systems and browsersAccess keys require you to hold down two or more keys.
Exceptions exist for specific browsers, and specific versions. For example,
Note, in cases of conflicts between the keyboard shortcuts assigned by browsers and access keys assigned by links and other markup on webpages, many browsers, including Mozilla, Netscape and Internet Explorer, allow access keys to override the browser defaults and require a different sequence to continue using overridden browser assignments (typically, by pressing and releasing the Alt key, instead of holding it down). Access key assignments in this PmWiki installationThe following is a list of the currently defined access keys for built-in actions. Remember that the letters identified below must be used together with the combination listed above (depending on your operating system and browser). Note that some actions do not have a corresponding access key by default.
Note: If the 'Key Value' is the same as the 'Key Name', the access key is currently undefined. When can these access keys be used
Following table explains which button is activated by which access key. Note that the Cancel button has no access key.
admins (intermediate) Customizing access keysPmWiki uses the same "phrase translation" methods for access key mappings as it does for internationalization. This makes it possible for administrators, skins, language translators, and visitors to all influence the way that specific keys are mapped to actions. See SitePreferences and Site.Preferences for more information and a template. Note that some skins (e.g., Lean) don't use the translation mechanism. In this case one must edit the template file itself in order to change the access keys. By convention, the translation phrases for all of the access key actions start with the characters "ak_", so that the page variable " Implementation of access keysAccess keys are implemented in html as optional parameters that can be added to links and many other types of markup. Example: The list of access key assignments in default PmWiki installations generally work throughout a site because links have been created in PmWiki skins and editing screens that incorporate access key parameters using the access key translation phrases. One location where those links can be viewed is Site.PageActions. That page contains the links that the default PmWiki skin, and many other skins, use to generate links such as "View" "Edit" and "History" that appear on most pages (other than editing screens). Each of the links in that page also has an 2 PmWiki.AccessKeys-Talk
PmWiki Administration TasksThis is a (experimental) list of all PmWiki administration related tasks that is organized in alphabetical order (and delimited by anchors so that it can be reused in other Wiki pages on this site). It is sort of based on core concepts of Darwin Information Typing Architecture (DITA) in which a topic is an archetype for information type. A topic is a unit of information that describes a single task, concept, or reference item. The information category (concept, task, or reference) is its information type (or infotype). Tasks that are general in nature are on a different page. In DITA terms, AdminTask? is a topic specialization of Task (which is a topic). Granted DITA is much more powerful and we cannot get all its benefits with PmWiki yet but perhaps one day, thanks to the genius of Pm, we can try and achieve more with every PmWiki release. This page (meaning its URL) itself should NOT be linked to from anywhere but the sections should be included by using a syntax such as: (:include PmWiki.AdminTask#start#end:).
Administering PasswordsYou can set passwords on pages and groups exactly as described above for authors. You can also:
For more information on password options available to administrators, see PasswordsAdmin. InstallationSetting Site Wide Passwords
One of the first things an admin should do is set an
Note that the To set the entire site to be editable only by those who know an "edit" password, add a line like the following to local/config.php:
Similarly, you can set $DefaultPasswords['read'] = array(pmcrypt('alpha'), pmcrypt('beta')); $DefaultPasswords['edit'] = pmcrypt('beta'); This says that either "alpha" or "beta" can be used to read pages, but only the "beta" password will allow someone to edit a page. Since PmWiki remembers any passwords entered during the current session, the "beta" password will allow both reading and writing of pages, while the "alpha" password allows reading only. A person without either password would be unable to view pages at all. To generate an encrypted string from your cleartext password so that the cleartext doesn't appear in the config file, go right to pmwiki.php?n=PasswordsAdmin??action=crypt
(add that to tail end of your address URL) for a form to use to encrypt the desired cleartext string into an encrypted string. Then simply copy the encrypted string and paste it in the config file where needed. --DP Upgrading
cp -a pmwiki-x.y.z/. pmwiki
Note that Mac OS X and other BSD systems will not not have the -a option as a command-line argument for cp, but that's okay, since it's just shorthand for cp -dpR, so use that instead of -a. On (some) FreeBSD servers you need to use cp -Rpv pmwiki-.x.y.z/. pmwiki
5. That's it! As long as you didn't make any customizations to the Cleaning Up Deleted Files When wiki pages are deleted, they leave behind residue as the deleted file isn't exactly deleted, but instead renamed to $FullName,del-TIMESTAMP. If you have a lot of deleted pages laying around, this builds up cruft in you file space. This is one method for cleaning up deleted pages. Contributors:Category: Administration
This page contains the instructions and possible responses from using the Site Analyzer. Instructions for site administrators
Checking the "Allow pmwiki.org to save a copy of analysis results" box will save a copy of the analyzer results in a private (web inaccessible) section of the pmwiki.org server. Having copies of results from many systems will help us to improve the analyzer and future configuration and security options for the PmWiki distribution. Obtain site configuration ... no connection The analyzer was unable to connect to the site. This may be because the url was entered incorrectly, the site is behind a firewall, or is otherwise inaccessible to the pmwiki.org server. Obtain site configuration ... missing analyzer The analyzer was able to reach the site, but the site did not respond to the include_once("$FarmD/cookbook/analyze.php"); $AnalyzeKey = 'secret'; Obtain site configuration ... no key The analyzer was able to contact the site, but the site does not appear to have an $AnalyzeKey set. Obtain site configuration ... invalid key The analyzer reached the Obtain site configuration ... update A newer version of the analyze.php script is available -- you may wish to download it and re-run the analysis.
Your site does not appear to have the
Your site appears to be vulnerable to the
All of the cookbook recipes active at this url appear to be up-to-date. Here's a list: (:recipetable:) There appear to be some new versions of cookbook scripts* available. Here's a list: (:recipetable:)
* Note: Not all scripts reported here are necessarily installed. This list includes all PHP scripts in the cookbook directory, regardless of whether they are included via config.php or not. (PmWiki reports on all scripts in the cookbook directory because they may be conditionally included in certain configurations.) AuthUser vulnerability ... ok Your site does not appear to have the AuthUser vulnerability. AuthUser vulnerability ... upgrade Your site does not have the AuthUser vulnerability at the moment. You are, however, strongly encouraged to upgrade to PmWiki version 2.2.2 or later, as some future configuration of your hosting server might put you at risk. AuthUser vulnerability ... probably vulnerable Your site may be vulnerable to AuthUser vulnerability, if it relies on the core module AuthUser for User:Password authentication. This vulnerability may be actively exploited in the wild, so you should do one of the following at the earliest opportunity:
Your site is running with You may want to change local/config.php to have if (CondAuth($pagename, 'edit')) $EnableDiag = 1;
Your site has the If you want PmWiki to use relative urls for its internal page links, try the 5 PmWiki.AQThis page is not a FAQ. It is just a repository for questions about PmWiki that have been answered. If you have asked a question about PmWiki and someone has given you the answer, please put them here. Then the next poor sod who has the same or similar question will at least have a chance of finding the answer on their own. This page started in response to the following question. Why don't we use a forum instead of this "AQ" page? Because the forums (otherwise known as message boards or bulletin boards) are great for holding conversations, but sometimes poor for reaching conclusions. At least here someone can edit my inane comment, sparing future readers the agony of reading it. Why not post "answers" on a page related to the question? Because some users, while quite willing to enter the text, can't figure out where to put it. This page at least provides a home for the answer until it can be moved elsewhere. It also means that searchers may find the answer here. Why doesn't my redirect file work? When doing test, you probably don't want to use the "index.php" name to don't kill your site at first. But be aware that the redirect line you have to include is a php script and must be pasted in any file with the "php" extension", for example "test.php", not any test.html... Category: Questions 6 PmWiki.AudiencesThis page contains Patrick Michaud's comments regarding the "audiences" for which PmWiki was designed. As such, many people are reluctant to modify the page, because it is a statement of his opinions and describes some of the thought that went into creating PmWiki. (And we all thank him for that!) Patrick's commentsI think of PmWiki in terms of two audiences:
In some senses it could be claimed that as the primary developer of PmWiki I should only have wiki administrators as my target audience, and that authors are the target audience for the administrators. But what really makes PmWiki useful to wiki administrators is that I've put a lot of consideration into creating a tool that is usable by authors, so I have to keep the needs of both audiences in mind as I'm designing and adding new features to PmWiki. Within the authoring audience I see that there are "naive authors" and "experienced authors". "Naive authors" are the folks who use wiki to generate content but may know next-to-nothing about HTML, much less style sheets or PHP or the like. Naive authors are easily discouraged from generating web content if they have to wade through markup text that has lots of funny and cryptic symbols in them. So, if we want a site with lots of contributors, we have to be very careful not to do things that will cause this group to exclude themselves from participating. "Experienced authors" are the folks who know a lot about HTML and could write their content as HTML, but have chosen to use wiki because of its other useful features (ease of linking, collaboration, ease of updates, revision histories, etc.) or because they want to collaborate with naive authors. Experienced authors usually don't have any problem with documents with lots of ugly markup in them; after all, they already know HTML. Experienced authors are sometimes frustrated with wiki because it doesn't have markup that would let them do something they know they can do in HTML (e.g., tables, stylesheets, colored text, etc.). And, they sometimes have difficulty understanding why naive authors would turn away from documents that have lots of markup sequences in them. For the wiki administrator audience--the folks who install and may want to customize PmWiki--their backgrounds and goals are often quite diverse. PmWiki is designed so that it can be installed and be useful with minimal HTML/PHP knowledge, but it doesn't restrict people who know HTML/PHP from doing some fairly complex things. For one, PmWiki allows a site administrator to build-in markup sequences and features customized to his/her needs (and the needs of his/her audiences). The separate needs of these audiences are behind most of the PmWikiPhilosophies. The people who develop PmWiki software must continually keep naive authors in mind as new features are requested and proposed by expert authors and Wiki Administrators. Sometimes it may seem to these latter groups that it's okay to implement the complex features because "naive authors don't have to use them", but the truth is that if complex/ugly markup sequences are available then they will eventually be used by someone, and once used they become a barrier to the naive authors. So, if I see that a feature could become a barrier to a naive author I don't include it in the base implementation of PmWiki, but instead find ways to let Wiki Administrators include it as a local customization. Patrick Michaud on the reasons behind Author variables: I have trouble with the idea that PmWiki can automatically designate
the "original author" -- many times pages are created as simple
placeholders, which other authors then come and fill in. So, I
think $Creator is probably better name than Lastly, PmWikiPhilosophy? #1 is "favor writers over readers",
and somewhat fundamental to that concept is that any reader
can also be an author, thus (In case any are wondering, "authorship" and "identity" are two
different things in PmWiki. The variable used to track the
"reader" or login is Radu: The idea of 'readers as authors' is somehow negated by the existence of separate 'read' and 'edit' password sets. I somewhat disagree. First, the 'read' password has nothing to do with this-- a read password doesn't separate a population into readers and authors, it separates them into readers and non-readers. So, it's only the edit password that tends to separate things -- but even there, an edit password doesn't have to be site-wide. The edit password can be used (and often is used) simply to say "you can author any page on the site except the ones protected by this password". Generally the edit password is used as a security measure, not as a classification or caste system. But in the final analysis, just because PmWiki promotes a particular view of the world doesn't mean it has to be totally consistent with it, or enslaved by it. In the "favor writers over readers" case, I'm rebelling against the traditional web maintenance architecture that limits pages to only one author (typically called the "webmaster"), and constrains everyone else to submitting their changes through that author. The philosophy isn't saying that everyone must be an author, it is saying that we should remove the barriers that prevent more people from becoming authors. See also: Cookbook:PageCreator - recipe allowing to store, access and modify a Creator variable. 8 PmWiki.AuthorTracking?-Talksimon August 03, 2015, at 09:19 PM
AuthUser is PmWiki's identity-based authorization system that allows access to pages to be controlled through the use of usernames and passwords. AuthUser can be used in addition to the password-based scheme that is PmWiki's default configuration. AuthUser is a very flexible system for managing access control on pages, but flexibility can also bring complexity and increased maintenance overhead to the wiki administrator. This is why PmWiki defaults to the simpler password-based system. For some thoughts about the relative merits of the two approaches, see PmWiki:ThoughtsOnAccessControl. See also: Cookbook:Quick Start for AuthUser. Activating AuthUserTo activate PmWiki's identity-based system, add the following line to local/config.php: include_once("
Ensure that you have set a site wide admin password, otherwise you will not be able to edit Note: Older versions of PmWiki (before 2.2.0-beta58) use Site.AuthUser .
PmWiki caches some group and page authorization levels when a page is accessed. For this reason, it is better to include
(If you don't use a custom PageStore? class and i18n, include All other recipes should be included after these. Creating user accountsMost of AuthUser's configuration is performed via the SiteAdmin.AuthUser page. To change the AuthUser configuration, simply edit this page like any other wiki page (you'll typically need to use the site's admin password for this). To create a login account, simply add lines to SiteAdmin.AuthUser that look like: username: (:encrypt password:)
For example, to create a login account for "alice" with a password of "restaurant", enter: alice: (:encrypt restaurant:)
When the page is saved, the " To change or reset an account's password, simply replace the encrypted string with another The password cannot contain spaces, tabs, new lines, colon ":" and equals "="; on some systems it should contain at least 4 characters. Usernames and passwords are case sensitive, eg. "User" is not the same as "user". Controlling access to pages by loginPages and groups can be protected based on login account by using "passwords" of the form It's possible to use multiple "id:" declarations and passwords in the quick id:alice,carol To allow access to anyone who has successfully logged in, use " One can also perform site-wide restrictions based on identity in the # require valid login before viewing pages $DefaultPasswords['read'] = 'id:*'; # Alice and carol may edit $DefaultPasswords['edit'] = 'id:alice,carol'; # All admins and Fred may edit $DefaultPasswords['edit'] = array('@admins', 'id:Fred'); You can change the
Organizing accounts into groupsAuthUser also makes it possible to group login accounts together into authorization groups, indicated by a leading "@" sign. As with login accounts, group memberships are maintained by editing the @writers: alice, bob carol: @writers, @editors @admins: alice, dave Then, to restrict page access to a particular group, simply use " Excluding individuals from password groupsGroup password memberships are maintained by editing the @wholeoffice: * If you need to keep "Fred" out of this password group : @wholeoffice: *,-Fred To allow all users except Fred to change page attributes, for example, you can add to
Getting account names and passwords from other PmWiki pagesIf you want PmWiki to get account names and passwords from other pages than SiteAdmin.AuthUser, you can set the variable
Before PmWiki version 2.2.108, you can point PmWiki to an other page than SiteAdmin.AuthUser, like this: From PmWiki version 2.2.108 forward This will have AuthUser check in all listed pages, with the same expected format as documented. If there are repetitions, later values will replace previous ones. Getting account names and passwords from external sourcesThe AuthUser script has the capability of obtaining username/password pairs from places other than the Passwd-formatted files (.htpasswd/.htgroup)Passwd-formatted files, commonly called .htpasswd files in Apache, are text files where each line contains a username and an encrypted password separated by a colon. A typical .htpasswd file might look like: alice:vK99sgDV1an6I
carol:Q1kSeNcTfwqjs?
To get AuthUser to obtain usernames and passwords from a .htaccess file, add the following line to htpasswd: /path/to/.htpasswd Creation and maintenance of the .htpasswd file can be performed using a text editor, or any number of other third-party tools available for maintaining .htpasswd files. The Apache web server typically includes an htpasswd command for creating accounts in .htpasswd: $ htpasswd /path/to/.htpasswd alice New password: Re-type new password: Adding password for user alice $ Similarly, one can use .htgroup formatted files to specify group memberships. Each line has the name of a group (without the "@"), followed by a colon, followed by a space separated list of usernames in the group. writers: carol editors: alice carol bob admins: alice dave Note that the groups are still "@writers", "@editors", and "@admins" in PmWiki even though the file doesn't specify the @ signs. To get AuthUser to load these groups, use a line in htgroup: /path/to/.htgroup Configuration via
|
What to type |
What it looks like |
Consecutive lines will be merged together as part of the same paragraph. One or more empty lines will start a new paragraph. | Consecutive lines will be merged together as part of the same paragraph. One or more empty lines will start a new paragraph. |
Two backslashes at the end of a line \\ force a line break. Or use this markup: [[<<]] to force a break. | Two backslashes at the end of a line Or use this markup: |
Further reading:
- text formatting rules for more information on linebreaks, indented or hanging paragraphs.
- wiki styles for centered or right justified paragraphs and "floating" text (boxes), borders and much more.
Lists
Start each line with #
for numbered (ordered) lists or *
for bulleted (unordered) lists:
* Bullet list * Another item ** More asterisks produce sub-items ** etc. |
|
# Numbered lists # Another item ## more hashes produce sub-items |
|
# List types # can be mixed ** numbered list with unordered sub-list |
|
Learn more about lists (including definition lists) and list styles.
Headings
Headings are useful for creating a "well-structured" page. They're not just for making big text.
What to type |
What it looks like |
!! Major Subheading !!! Minor Subheading !!!! And More !!!!! Subheadings | Major SubheadingMinor SubheadingAnd MoreSubheadings |
Text emphasis
To emphasize, enclose text in apostrophes (single-quote marks), not double-quotes.
What to type |
What it looks like |
''Emphasize'' (italics), '''strong''' (bold), '''''very strong''''' (bold italics). | Emphasize (italics), strong (bold), very strong (bold italics). |
Links
To make a link to another page, enclose the page's name in double square brackets.
What to type |
What it looks like |
Practice editing in the [[PmWiki/wiki sandbox]] | Practice editing in the wiki sandbox |
Note that words are automatically capitalized in page titles. The link above links to the page WikiSandbox.
Text after a pipe (|) is used as the link text:
Practice editing in the [[PmWiki/WikiSandbox | practice area]]. | Practice editing in the practice area. |
Endings become part of the link text, parentheses hide parts of the link name:
[[PmWiki/wiki sandbox]]es. [[PmWiki/(wiki) sandbox]]. |
When linking to a page in a different WikiGroup, provide the group name, followed by a separator, and then the page name:
[[Main.Wiki Sandbox]] shows group + name [[Main/Wiki Sandbox]] shows only name | Main.Wiki Sandbox shows group + name Wiki Sandbox shows only name |
Links to external sites
bare url: https://www.pmwiki.org link text: [[https://www.pmwiki.org | PmWiki home]] | bare url: https://www.pmwiki.org link text: PmWiki home |
Links as reference to external sites
bare url: https://www.pmwiki.org link text: [[https://www.pmwiki.org | #]] | bare url: https://www.pmwiki.org link text: [1] |
To add a tooltip title to a link, add it in quotes after the page name or the URL:
Hover your mouse cursor over the links to see the tooltip. * [[Documentation Index"Return to our help center"]] * [[https://www.pmwiki.org"Collaborative Wiki-based CMS" | PmWiki]] |
Hover your mouse cursor over the links to see the tooltip. |
Colons make InterMap (also called InterWiki?) links to other wikis:
What's an [[Wikipedia:aardvark]], anyway? | What's an Wikipedia:aardvark, anyway? |
Links to nonexistent pages? are displayed specially, to invite others to create the page.
PmWiki supports more link types and a lot of display options, see Links to learn more.
Escape sequence
If you don't want Wiki markup to be processed, but lines reformatted use [= =]
. Can also be used inline.
[= markup is ''not'' processed but lines are reformatted =] | markup is ''not'' processed but lines are reformatted |
Preformatted text
Preformatted text is displayed using a monospace font and not generating linebreaks except where explicitly indicated in the markup.
Note that very long lines of preformatted text can cause the whole page to be wide.
For preformatted text with markup (e.g. emphasis) being processed, start each line with a space:
Lines that begin with a space are formatted exactly as typed in a '''fixed-width''' font. | Lines that begin with a space are formatted exactly as typed in a fixed-width font. |
If you don't want Wiki markup to be processed, use [@ @]
. Can also be used inline.
[@ Text escaped this way has the HTML ''code'' style @] | Text escaped this way has the HTML ''code'' style |
You can also use the escape sequence preceded with a space on the first line.
[=The '''escape sequence''', preceded by space(s) on the first line, is rendered preformatted.=] | The '''escape sequence''', preceded by space(s) on the first line, is rendered preformatted. |
You can enable code highlighting for preformatted blocks with recent PmWiki versions.
Horizontal line
Four or more dashes at the beginning of a line ---- produce a "horizontal rule" | Four or more dashes at the beginning of a line produce a "horizontal rule" |
Tables
Simple tables use double pipe characters to separate cells:
|| border=1 ||! head 1 ||! head 2 ||! head 3 || || cell 1 || cell 2 || cell 3 || |
|
See simple tables and advanced tables to learn more about the rich feature set of PmWiki tables.
Images
See Images
Character formatting
What to type |
What it looks like |
* @@Monospaced text@@ * Text with '^superscripts^' * Text with '_subscripts_' * deleted {-strikethrough-} text * inserted {+underline+} text * [+big+], [++bigger++] text * [-small-], [--smaller--] text |
|
Use WikiStyles to change the text color .
Page titles
The (:title:)
directive sets the page's title to something other than its page name.
(:Title Basic PmWiki editing rules:) The name of this page is "{PmWiki.BasicEditing$Name}", and its title is "{PmWiki.BasicEditing$Title}". | The name of this page is "BasicEditing", and its title is "Basic PmWiki editing rules". |
Page description
- The
(:Description Page description here:)
directive sets the page description. The description is used by search engines, and can be displayed in search results and in page lists.
(:Description PmWiki's basic editing rules:) The summary description of this page is "{PmWiki.BasicEditing$Description}". | The summary description of this page is "PmWiki's basic editing rules". |
Page summary
(:Summary:Page summary here:)
is a PageTextVariable that is used in some of the default PageList templates.
(:Summary:PmWiki's basic edit syntax:) The summary of this page is "{PmWiki.BasicEditing$:Summary}". | The summary of this page is "PmWiki's basic edit syntax". |
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 top or 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 such as Copyright (©) and Trademark (® or ™) on my wiki pages?
See special characters on how to insert special characters that don't appear on your keyboard.
How can I preserve line-breaks from the source text?
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. An author can use the (:linebreaks:)
directive to cause the following lines of markup text in the page to be kept as separate lines in the output. Or a wiki administrator can set in config.php
to enable line breaks by default.
$EnablePreserveLineBreaks
= 1;
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 Audiences. Enabling HTML markup within wiki pages in a collaborative environment may exclude some potential authors from being able to edit pages, and pose a number of display and security issues. However, a site administrator can use the Cookbook:Enable HTML recipe to enable the use of HTML markup directly in pages.
Where can I find more documentation?
See the documentation index and the markup master index pages.
15 PmWiki.BasicEditing-Talk
The title attribute also works as a tooltip.
Examples show the title attribute set in image links in double quotes adjacent to the right side of the image file reference.
[[URL|image"title attribute text"]]
see: https://www.pmwiki.org/wiki/PmWiki/Images#links
This will not work for a text link. I had an extremely difficult time finding that this works for a text link by putting the title attribute text in double quotes adjacent to the left side of the URL
[[https://pmwiki.org"title attribute text"|PMWiki]]
This works - mouse over the link and see the tooltip:
[[https://pmwiki.org"title attribute text is here"|PMWiki with HTML title attribute set]] |
This will not work:
[[https://pmwiki.org|PMWiki with HTML title attribute set"no title attribute text is here"]] |
PMWiki with HTML title attribute set"no title attribute text is here" |
I also found the title/tooltip being adjacent to the URL appears to work too.
Someone didn't consider this to be "basic", so it is documented in Links#tooltiptitle. In fact, Attach: with a picture was implemented by Pm, then later I added it for external links, and even later for page links. The "Attach:" prefix is an InterMap prefix for PmWiki (like "https:") so these use the same logic. --Petko
Where the variables are available as wiki markup they are shown as Variable value "{$VariableName}
".
- %apply=item id=AsSpacedFunction?%
$AsSpacedFunction
- The name of the function used to convert WikiWords? into normal, spaced strings. Defaults to '
AsSpaced?
'. $AsSpacedFunction = 'MyAsSpaced';
$Author
is currently ""
$Author
- Set to the current reader, who is potentially an author (see discussion). See also
$EnablePostAuthorRequired
. - %apply=item id=AuthorGroup?%
$AuthorGroup
- The WikiGroup? for user profiles. Defaults to '
Profiles
'. This variable is implicit in the markup[[~AuthorName]]
$AuthorGroup = 'Users';
- %apply=item id=AuthId?%
$AuthId
- For sites using user-based authorization, tracks the "reader" or login name.
SessionAuth($pagename);
if( isset($AuthId) ) { // this person has been authenticated
- %apply=item id=AuthPw%
$AuthPw
- Request for documentation, meanwhile see AuthId vs AuthPw.
SessionAuth($pagename);
if( isset($AuthPw) ) { // this person has entered a password
$BaseName
is currently "PmWiki.BasicVariables"
- %apply=item id=BaseName%
$BaseName
- %apply=item id=BaseNamePatterns?%
$BaseNamePatterns
- Allows population of the
{$BaseName}
PageVariable. The key to the hash is the pattern to be replaced and the value is the replacement string. # If {$FullName} is 'Group.Page-Draft' then {$BaseName} is 'Group.Page' $BaseNamePatterns['/-Draft$/'] = ''; # If {$FullName} is 'Comments-Group.Page' then {$BaseName} is 'Group.Page' $BaseNamePatterns['/^Comments-/'] = '';
- %apply=item id=CategoryGroup?%
$CategoryGroup
- The WikiGroup? used for categories. Defaults to '
Category
'. (See Categories). This variable is implicit in the markup[[!CategoryName]]
- %apply=item id=CookiePrefix?%
$CookiePrefix
- A string prefix to be prepended to cookies set from PmWiki scripts. It defaults to '', but can be set to a different value to avoid conflicts with similar-named cookies from other applications, or to allow multiple wikis from the same domain to store separate cookies.
$CookiePrefix = 'pmwiki_'; # set cookie prefix to 'pmwiki_'
- If you have a WikiFarm, use the following in each field's
config.php
to get a unique prefix for each field in the farm, thus isolating each field's cookies.
- If you have a WikiFarm, use the following in each field's
$CookiePrefix = substr($tmp = md5(__FILE__), 0, 5).'_';
$DefaultGroup
is currently "PmWiki"
- %apply=item id=DefaultGroup?%
$DefaultGroup
- WikiGroup used by default (on startup) when no group is specified in the URL.
$DefaultName
is currently "HomePage"
- %apply=item id=DefaultName?%
$DefaultName
- Name of the default HomePage of each WikiGroup?. Used when the group doesn't have a page with the same name as the group.
- Note that the behavior will differ based on whether the page exists or not. Probably you want to alter
$PagePathFmt
in addition to$DefaultName
if you really want it to take effect.
$DefaultPage
re the order how this must be defined within your (farm)config.php
scripts - this must be set prior to any call of ResolvePageName()
.
- %apply=item id=DefaultPage?%
$DefaultPage
- Startup page when PmWiki is called without a specified page, normally
.$DefaultGroup
.$DefaultName
$DefaultGroup
, $DefaultName
and $DefaultPage
variables to work, they should be defined in the beginning of (farm)config.php
, before any call to the function ResolvePageName?()
. This means, before any script from PmWiki and before any recipe that might be using this function. This also means it cannot be set in a per-page or per-group customization script - ResolvePageName?()
is called before these are loaded.
- Please note that this variable is intended to be set in
(farm)config.php
, not in individual groups. Trying to use different
,$DefaultName
or$DefaultPage
$PagePathFmt
- %apply=item id=EnableCommonEnhancements?%
$EnableCommonEnhancements
- This variable enables popular core functions for easier editing and review:
-
$EnableCommonEnhancements
= 1; - In this case, the following configuration options are enabled, unless they are already defined or disabled in config.php (click on each variable to learn more):
# Security + review changes$EnableCookieHTTPOnly
= 1;$EnableObfuscateEmails
= 1;$EnableRCDiffBytes
= 1;$EnableLocalTimes
= 3; # Editing$EnablePreviewChanges
= 1;$EnableMergeLastMinorEdit
= 12*3600; # 12 hours$EnableListIncludedPages
= 1;$EnablePmSyntax
= 2;$EnableEditAutoText
= 1;$EnableGUIButtons
= 1;$EnableGuiEditFixUrl
= 220; # after external link button # Documentation$PmTOC
['Enable'] = 1;$PmTOC
['EnableBacklinks?'] = 1;$EnableCopyCode
= 1; # Uploads (if enabled)$EnableUploadDrop
= 1;$EnableRecentUploads
= 1;$EnableUploadVersions
= 1;
- %apply=item id=EnableLocalConfig?%
$EnableLocalConfig
- Allows/disables
local/config.php
customizations (usually for a farm's wikis). Can be set to zero inlocal/farmconfig.php
to prevent the farm's wikis'local/config.php
from being loaded. $EnableLocalConfig = 0; # disable PmWiki's local/config
- %apply=item id=EnableStdConfig?%
$EnableStdConfig
- Disables
scripts/stdconfig.php
and a large part of the core functionalities provided by the scripts in thepmwiki/scripts
directory and outlined in the core documentation, unless included by your own local configuration (notably core markup rules, page history, skins, uploads). Allows you to completely reshape the way PmWiki behaves, if you need to. $EnableStdConfig = 0; # disable many standard features
- %apply=item id=EnablePGCust?%
$EnablePGCust
- Allows/disables per-page and per-group customizations. Can be set to zero in any local customization file to prevent remaining page/group customizations from being loaded.
$EnablePGCust = 0; # turn off per-page/group configs
- %apply=item id=EnableBaseNameConfig?%
$EnableBaseNameConfig
- When enabled, and if the page has a different base page (per
$BaseNamePatterns
), will include the local configuration for the base page. For example, if the page is "Group.Page-Draft", this would try to include the filelocal/Group.Page.php
in addition tolocal/Group.Page-Draft.php
. $EnableBaseNameConfig = 1; # include basename configuration
- %apply=item id=EnableRedirect?%
$EnableRedirect
- When enabled (default), causes page redirects to automatically be performed by the browser. Setting
$EnableRedirect
to zero causes PmWiki to pause and issue a "Redirect to link" message instead. This is sometimes useful when debugging recipes to be able to see the results of actions before page redirections occur. Not to be confused with$EnableRedirectQuiet
. - %apply=item id=EnableWikiWords?%
$EnableWikiWords
- Enable WikiWord processing.
- %apply=item id=EnableWSPre?%
$EnableWSPre
- Enables a markup rule that causes lines with leading spaces to be treated as sections of preformatted text. If set to a value greater than 1, indicates the minimum number of leading spaces required for this treatment.
$EnableWSPre = 1; # leading spaces are preformatted text
$EnableWSPre = 0; # leading spaces are normal lines of text
$EnableWSPre = 4; # 4+ spaces are preformatted text
- %apply=item id=FTimeFmt?%
$FTimeFmt
- Can be used to override the default date format used by the "
ftime
" function. The default$FTimeFmt
is$TimeFmt
. (See Markup Expressions.) - %apply=item id=GroupPattern?%
$GroupPattern
- The regular expression pattern used for valid WikiGroup name specifications. Defaults to allowing any group name beginning with an uppercase letter, but can be set to limit the valid group names (see Cookbook:LimitWikiGroups).
# limit groups to Site, SiteAdmin, PmWiki, and MyGroup
$GroupPattern = '(?:Site|SiteAdmin|PmWiki|MyGroup)';
#for case-sensitive group names, note the ?-i switch:
$GroupPattern = '(?-i:Site|SiteAdmin|PmWiki|MyGroup)';
- %apply=item id=LinkWikiWords?%
$LinkWikiWords
- If set, then bare WikiWords? in a page are automatically linked to pages of the same name. Note that this value can also be affected by the
(:linkwikiwords:)
and(:nolinkwikiwords:)
directives. $LinkWikiWords = 1; # turn on WikiWord links
$LinkWikiWords = 0; # disable WikiWord links
- Note, this setting requires WikiWords? to be enabled, see
$EnableWikiWords
. - %apply=item id=LogoutRedirectFmt?%
$LogoutRedirectFmt
- Identifies the page to which the visitor should be sent after an
?action=logout
. Defaults to the current page. $LogoutRedirectFmt = 'Site.Logout'; # ?action=logout target
- %apply=item id=LogoutCookies?%
$LogoutCookies
- An array of cookie names to be removed when
?action=logout
is invoked. - %apply=item id=NamePattern?%
$NamePattern
- The regular expression pattern used for valid page names. Defaults to allowing pages beginning with an uppercase letter or digit, followed by sequences of alphanumeric characters, hyphens, and underscores.
$pagename
- A variable that gives the name of the current page.
$pagename=$GLOBALS['MarkupToHTML']['pagename'];
global $pagename;
# if you use it inside a function
$pagename = ResolvePageName($pagename);
$pagename
, page variables become accessible:
$page = PageVar($pagename, '$FullName'); # =$pagename $group = PageVar($pagename, '$Group'); $name = PageVar($pagename, '$Name');
- %apply=item id=PagePathFmt?%
$PagePathFmt
- An array controlling how the default group home-page name will be determined.
- Please note that this variable is intended to be set in
(farm)config.php
, not in individual groups. Trying to use different
,$DefaultName
or$DefaultPage
settings in different groups will cause cross-group linking anomalies.$PagePathFmt
$PagePathFmt = array('{$Group}.$1','$1.$1','$1.{$DefaultName}');
$DefaultName
to actually be the name of your group home-pages:
$PagePathFmt = array('{$Group}.$1','$1.{$DefaultName}','$1.$1');
Groupname.Groupname
page does exist but Groupname.Defaultname
does not exist, then Groupname.Groupname
will still take precedence. You may remove the '$1.$1
' entirely to require Groupname.Defaultname
to be the group homepage - that would look like this:
$PagePathFmt = array('{$Group}.$1','$1.{$DefaultName}');
$SiteGroup
is currently "Site"
- %apply=item id=SiteGroup?%
$SiteGroup
- Default group for storing configuration and utility pages such as Site.Search, Site.EditForm, Site.PageNotFound, etc.
- %apply=item id=SiteAdminGroup?%
$SiteAdminGroup
- Default group for locked administrative pages such as SiteAdmin.AuthList, SiteAdmin.AuthUser, SiteAdmin.ApprovedUrls, etc, defaults to '
SiteAdmin
'. $Skin
- The name of the directory containing the skin (theme) files, default "pmwiki". See Skins.
- %apply=item id=SpaceWikiWords%
$SpaceWikiWords
- If set, then WikiWords? in pages are automatically spaced according to
$AsSpacedFunction
. Note that this value can also be affected by the(:spacewikiwords:)
and(:nospacewikiwords:)
directives. $SpaceWikiWords = 1; # turn on WikiWord spacing
$SpaceWikiWords = 0; # turn off WikiWord spacing
- %apply=item id=TimeFmt?%
$TimeFmt
- The format to use for dates and times, in
strftime()
format. The default value is'%B %d, %Y at %I:%M %p'
, which gives dates of the form "September 8, 2005 at 10:57 PM". Formats$CurrentTime
variable. $TimeFmt = '%B %d, %Y'; # dates as "September 8, 2005"
$TimeFmt = '%Y-%m-%d'; # dates as "2005-09-08"
- %apply=item id=EnableFTimeNew?%
$EnableFTimeNew
- If set to 1, enables the new functions to format dates and times for PHP before 8.1. This allows you to preview the outputs of dates and times, for example in the page footer, in Recent Changes and page histories, or with the
{(ftime)}
markup expression. See explanation at Functions#PSFT. (For PHP 8.1, strftime() is deprecated, and the new functions are enabled by default.)
$Version
is currently "pmwiki-2.3.37"
$Version
- A string representing the release version of PmWiki.
$VersionNum
is currently "2003037"
- %apply=item id=VersionNum?%
$VersionNum
- A number representing the release version of PmWiki,
with the major and minor release components padded with zeroes to
produce three digits. Thus, release "pmwiki-2.1.40" will have
$VersionNum
set to 2001040. The first digit is a 2, the next three digits are the major release number, and the last three digits are the minor release number. Beta releases use 900-999 for the minor release number. Thus:2.1.0 2001000 2.1.1 2001001 ... 2.1.27 2001027 2.2.0-beta1 2001901 2.2.0-beta2 2001902 ... 2.2.0-beta18 2001918 ... 2.2.0 2002000
- %apply=item id=WikiWordPattern?%
$WikiWordPattern
- The pattern that describes a WikiWord.
- %apply=item id=EnableRelativePageVars?%
$EnableRelativePageVars
- This setting controls how Page variables in included pages are understood by PmWiki.
$EnableRelativePageVars
= 1; # PmWiki current default
In this case{$Name}
displays the name of the physical page where it written. If{$Name}
is in an included page, it will display the name of the included page. (This is currently PmWiki's default.)$EnableRelativePageVars
= 0; # revert to previous default
In this case{$Name}
displays the name of the currently browsed page. Even if{$Name}
is in an included page, it will display the name of the browsed page. This was PmWiki's default in versions 2.2.8 and earlier, and changed in 2.2.9, but you can revert it back with this line in config.php.-
{*$Name}
with an asterisk always displays the name of the currently browsed page, regardless of$EnableRelativePageVars
.
Categories: PmWiki Developer
17 PmWiki.Blocklist
The block list is one of a number of security measures that can be taken to protect your wiki from spam and other unwelcome postings.
Unfortunately, the open-editability of many wiki systems often makes them attractive targets for "link spam" or "wikispam", in which links are added to pages in an effort to increase search engine rankings or drive traffic to other sites. Also, many link spammers have developed automated systems to locate sites that accept visitor input and attempt to flood the site with unwanted links. Also, and harder to deal with, is just plain wiki vandalism where nonsense changes are made, often replacing entire pages.
By far the best countermeasure against wikispam is to restrict editing through the use of passwords (see Passwords and Passwords Admin). Experience has shown that passwords can be effective even if the password is widely known, and even if the password is publicly available on the site itself. However, there are many cases where passwording may be an impediment, so these will generally want to use some form of blocklist.
Blocklist basics
A blocklist is a list of IP addresses, phrases, and expressions which are prevented from being added into pages on the website. PmWiki is distributed with a built-in blocklisting capability; blocklists can be enabled by adding the following line to local/config.php
:
$EnableBlocklist = 1;
This tells PmWiki to scan the SiteAdmin.Blocklist page and the "SiteAdmin.Blocklist-Farm" page (and possibly other pages -- see below) looking for phrases and IP addresses to be excluded from posting to the site.
Blocking by word or phrase
The simplest form of block is simply a line containing "block:
" followed by a word or phrase to be excluded from postings. For example, a line like
block:spam.com
in SiteAdmin.Blocklist
will block any posts containing the string "spam.com" (case-insensitive) anywhere in the post.
Blocking by IP address
Sometimes we wish to restrict posts coming from particular addresses or address ranges that are known as sources of wikispam. If a blocklist page contains IP addresses of the form "a.b.c.d" or "a.b.c.*", then any posts coming from that address or range will be blocked.
Blocking by regular expression or pattern
Blocking on simple words can sometimes pose difficulties; for example, a simple "block:cial
" entry will also block the word "specialist". For these cases it's often helpful to use a regular expression, as in:
block:/\bcial\b/
This says to block "cial
" only if it doesn't occur in the middle of a larger word. The leading slash (/) after "block:" tells PmWiki to use a regular expression match instead of a simple string match. (Blocklist uses PCRE or "Perl Compatible Regular Expressions"; see PCRE functions for more information.)
Regular expression to block 'href'
If you want to block 'href
', you can use the following markup:
block:/[^\w\\]href\b/
which blocks 'href
', but neither '\href
' nor 'toughref
'.
The regular expression can be interpreted as follows: Match any character that is neither a word character
nor a '\', followed by href
which ends in a word boundary.
Letting authors know why they've been blocked
By default, blocklist only tells an author that a particular edit has been blocked, but doesn't give a specific reason for the blocking (e.g., the offending phrase). Setting the following in a local customization file will also provide the reasons for the block:
$EnableWhyBlocked = 1;
Managing multiple blocklists
PmWiki allows blocklist entries to come from multiple pages by setting the $BlocklistPages
variable. By default $BlocklistPages
is set to "SiteAdmin.Blocklist
", as well as any automatically downloaded blocklists as described below. PmWiki will use all entries in all the blocklists for filtering wikispam. Setting a value of $BlocklistPages
changes the default:
$BlocklistPages = array('Main.Blocklist', '{$Group}.Blocklist');
The order of blocklists really doesn't matter -- all of the blocklist
pages ultimately get used, and the unblock:
entries are processed
after all of the blocklist pages have been loaded.
Automatically downloaded blocklists
Maintaining blocklists is relatively easy to do, but can become tedious over time. Several groups have formed and maintain "shared blocklists", where a common blocklist is made available to all. PmWiki's blocklist capability has built-in features for automatically downloading and updating such shared blocklists.
If you're just in a hurry to make use of some standard blocklists, make the following setting in local/config.php
:
$EnableBlocklist = 10;
This tells PmWiki to not only enable blocklists on the site, but to also configure itself to automatically retrieve and maintain local copies of well-known blocklists such as MoinMaster. These local copies will be saved in SiteAdmin.Blocklist-MoinMaster?
and refreshed once per day (as determined by the value of $BlocklistDownloadRefresh
).
To automatically retrieve the SiteAdmin.Blocklist page used at pmwiki.org, add the following setting in local/config.php
:
$BlocklistDownload["$SiteAdminGroup.Blocklist-PmWiki"] = array('format' => 'pmwiki');
The blocklist from chongqed.org which we used in the past is no longer available as of 2013.
Ignoring specific entries in a blocklist (unblock)
When using a large master blocklist or blocklists automatically refreshed from external sites, it may be that some entries in the blocklists are inappropriate or overeager and block legitimate content. In this case a wikiadministrator can use "unblock" in a blocklist page to ignore an entry from the blocklist. For example, to allow "spam.com" even if another blocklist has a block entry for it:
unblock:spam.com
In order for unblocking to work the phrase or pattern following "unblock:" must be exactly the same as the original.
Permissions on blocklist pages
In general, an administrator will want to edit-protect the SiteAdmin.Blocklist
and any other blocklist pages to prevent arbitrary changes to the blocklist (see Passwords). Since most pages in the SiteAdmin.*
group are edit-protected by default anyway, this usually isn't a problem.
Administrators may also wish to read-protect the various blocklist pages so that others do not know the exact phrases and/or IP addresses that are being blocked. (By their nature blocklists tend to contain phrases or terms that may be offensive or inappropriate to some.)
Any pages created via automatic download (see above) are automatically locked against viewing except by administrators.
administrators (intermediate)
Detailed configuration of automatically downloaded blocklists
Automatic downloading of blocklist information is controlled by the $BlocklistDownload array. An entry for MoinMaster? might look like:
$BlocklistDownload["$SiteAdminGroup.Blocklist-MoinMaster"] = array( 'url' => 'http://moinmo.in/BadContent?action=raw', 'format' => 'regex', 'refresh' => 86400);
This says to download the blocklist data from the given url into the SiteAdmin.Blocklist-MoinMaster?
page, that the entries in the blocklist are regular expressions, and to refresh the information every 86,400 seconds (one day).
If 'refresh' is omitted, then the page will be refreshed at the time interval given by $BlocklistDownloadRefresh
(default one day). If 'format' is omitted, the page is assumed to have PmWiki-formatted entries as described above. If 'url' is omitted, then the blocklist information is downloaded from a standard location on the pmwiki.org site.
To force a refresh of an automatically downloaded blocklist, simply delete the existing page -- a new version will be installed upon the next blocklist scan. Blocklist pages are checked for download in response to any ?action=edit request.
If you are specifying your Blocklist-Pages in the config.php you have to specify the automatically updated pages too, else they won't be updated or created even if you use $EnableBlocklist = 10;
.
Farm-wide blocklist
A blocklist can be applied farm-wide (see SharedPages).
After these pages are created they can be moved into the farm shared.d/
directory:
Blocklist Variables
The following variables help control the configuration and operation of blocklists:
$EnableBlocklist
- If set to a non-zero value, then blocklists are enabled on the site. If set to a value of ten or higher, then add entries for automatic downloads of standard blocklists.
-
$EnableBlocklist = 1; # enable blocklists
-
$EnableBlocklist = 10; # auto-configure standard blocklists
$EnableWhyBlocked
- By default, authors are not told which particular phrases or IP addresses are causing a particular post to be blocked; setting
$EnableWhyBlocked
to 1 provides this information. -
$EnableWhyBlocked = 1; # give reasons for blocking
$BlocklistPages
- An array of pages to be checked for blocklist entries. The elements of the array may contain page variables. Defaults to "
SiteAdmin.Blocklist
", plus any other automatically downloaded blocklist pages. $BlocklistMessageFmt
- The message to provide the author whenever a post has been blocked.
$BlockedMessagesFmt
- If
$EnableWhyBlocked
is set, defines the text to use for each type of block being performed. Currently only 'ip' and 'text' are recognized. -
$BlockedMessagesFmt['ip'] = "IP address blocked from posting: ";
-
$BlockedMessagesFmt['text'] = "Text blocked from posting: ";
$BlocklistDownload
- An array of automatically-downloaded blocklists. The keys of the array are the pages in which the blocklists should be stored, the values contain the url, format, and refresh interval for the downloaded blocklist.
# Download the MoinMaster blocklist every twelve hours $BlocklistDownload["$SiteAdminGroup.Blocklist-MoinMaster"] = array( 'url' => 'http://moinmo.in/BadContent?action=raw', 'format' => 'regex', 'refresh' => 43200); # Download a shared blocklist from pmwiki.org every day $BlocklistDownload["$SiteAdminGroup.Blocklist-Shared"] = array( 'format' => 'pmwiki');
$BlocklistDownloadRefresh
- The default refresh interval for any
$BlocklistDownload
entries that don't explicitly specify a 'refresh' value. -
# perform automatic downloads once per week by default
-
$BlocklistDownloadRefresh = 86400 * 7;
$BlocklistDownloadFmt
- The format to use when saving automatically downloaded blocklists.
$EnableBlocklistImmediate
- Some cookbook recipes update pages with author input but don't use the built-in data posting routines. If
$EnableBlocklistImmediate
is set (default) and the current action is listed in$BlocklistActions
(below), then an immediate blocklist scan is performed on the incoming text. $BlocklistActions
- A list of actions for which immediate blocklist checks should be performed (see
$EnableBlocklistImmediate
above). -
# perform immediate checks for ?action=comment
-
$BlocklistActions['comment'] = 1;
-
# perform immediate checks for ?action=postdata
-
$BlocklistActions['postdata'] = 1;
18 PmWiki.Blocklist-Talk
This is a talk page for improving Blocklist.
How do i configure the blocklist to also check third party cookbook scripts, in my case Cookbook.Guestbook? This scripts posts to pmwiki using the hidden field action=guestbook in the form.
So i have tried putting in tho local config:
$BlocklistActions['guestbook'] = 1;
But that does not get it working. If i try it manually by calling the blocklist from within the guestbook-script
global $Enablepost; Blocklist($pagename,$some_text_string); if ($Enablepost) { WritePage($datapagename,$rcpage); }
Bas? May 05, 2008, at 03:52 PM
blocklist bug! I create SiteAdmin.Blocklist
SiteAdmin.Blocklist
block:caca.com
config.php
$EnableBlocklist = 1;
When I edit a page, the script "scripts / blocklist.php" is played ... caca.com but is added to the page ...
Help please!
the script never gets in the if clause as Enablepost is not set?
$EnablePost is set to 1 early in pmwiki.php. Do you have a standard pmwiki installation or there are some recipes which use a different mechanism for editing pages? --Petko February 15, 2012, at 01:58 AM
EDIT ! Thanks ! My problem is with the translation ;)
Vous pouvez m'écrire en français. Le Blocklist fonctionne sur plusieurs wikis. Je ne sais pas si Fox est compatible avec Blocklist, si vous modifiez des pages avec des formulaires Fox, je suppose qu'il faut demander au développeur HansB (en anglais ou en allemand). --Petko February 15, 2012, at 03:55 PM
Pour les activer Blocklist avec Fox je viens de faire $BlocklistActions['foxpost'] = 1;
et ça marche !(dans config.php)
How do I temporarily disable the blocklist. I have a password-edit only site with HTML enabled and want(!) to be able to add javascript <script> tags etc. on my sidebar. I can re-enable it when my edit (add a searchbox) is done. $EnableBlocklist = 0; is not working. XES July 05, 2013, at 07:44 AM
I do not manage to get the automatic blocklist download working (pmwiki blocklist) A file SiteAdmin.Blocklist-pmwiki is created, but it is empty.
Any hints? Klonk November 06, 2013, at 01:25 PM
It should be SiteAdmin.Blocklist-PmWiki with proper capital letters, not all lowercase pmwiki. Use the following in config.php to download it. --Petko November 06, 2013, at 06:16 PM
$EnableBlocklist = 10; # not 1
$BlocklistDownload["$SiteAdminGroup
.Blocklist-PmWiki"] = array('format' => 'pmwiki');
Sorry, a misspelling from my side. But see yourself how it looks like: http://www.loncarek.de/pages/SiteAdmin/Blocklist-PmWiki
Maybe I forgot some configuration? Or are there some special rights I have to give? Or modules to load/activate? Klonk November 07, 2013, at 01:24 AM
That group is password-protected so I cannot see the page and even if there is a page Blocklist-PmWiki. Do you have $EnableBlocklist = 10; and not 1? --Petko November 07, 2013, at 02:22 PM
Yes I have $EnableBlocklist = 10; And the only content of that created page is:
## blocklist-note: NOTE: This page is automatically generated by blocklist.php ## blocklist-note: NOTE: Any edits to this page may be lost! ## blocklist-url: listDownloadUrl ## blocklist-when: 2013-11-09T08:13:10 # blocklist-format: listFormat listData
Klonk November 09, 2013, at 01:57 AM
Do you have a custom markup or a custom PageVariable called {$Block}
in (farm)config.php, in a recipe or in a skin? It may get evaluated before the blocklist functions get to save the data. Disable that markup/variable and try again. --Petko November 09, 2013, at 03:57 AM
I haven't found anything. Disabled all recipes and skins - still does not work! After some more testing: For whatever reason sometimes it is loaded, sometimes not.... I have no idea. I use the fox cookbook reciepe and I don't know wheter blocklist works there anyways... Klonk November 10, 2013, at 06:06 AM
I haven't had the opportunity to review Fox. You should test if it works with the normal PmWiki editing mecanism. In the page content you posted above, instead of listDownloadUrl, listFormat and listData, PmWiki has $BlocklistDownloadUrl, $BlocklistFormat and $BlocklistData just before the downloaded list is saved to the page. Upon saving, these variables are replaced with their values, "https://www.pmwiki.org/blocklists/SiteAdmin.Blocklist-PmWiki", "pmwiki" and the content of SiteAdmin.Blocklist. The fact that you see listFormat means that in some of your *.php file(s) there is a variable $Block or {$Block} which is defined and is empty, so the "$Block" part from "$BlocklistFormat" is replaced with nothing, before the replacement of the full $BlocklistFormat which never happens. The fact that you see the time means that the $CurrentTimeISO variable is correctly replaced with the time. So the replacement works but there is a variable $Block that breaks some of the other variables. I would scan all *.php files looking for "$Block" in order to find it and deactivate it - eventually renaming it to something different. --Petko November 10, 2013, at 09:03 AM
Also note that PmWiki waits at least 24 hours before trying to download the data again. While testing you may want to set in config.php $BlocklistDownloadRefresh = -1;
so that it will try to download the data at every save. When it works, remove this line. --Petko November 10, 2013, at 09:15 AM
It took me some time, but I guess, I found it. Seems to be bug in PmWiki!
The only position I found $Block
was in pmwiki.php
line 1483, in function FormatTableRow?
. There a global variable $Block
was defined but nowhere used. Can you confirm that? If so, should I open a PITS issue or will you?
Earliest this evening I have access to my server to check whether removing the global variable $Block
helps.
Thanks for your patience and help! Klonk November 21, 2013, at 05:27 AM
This is a nice catch, thanks. (I wonder how that function is triggered on your wiki and not on others.) No need to open a PITS entry, I just removed the variable for the next version. I hope that it will fix your blocklist problems. --Petko November 21, 2013, at 02:15 PM
"Block markup" is a term used in the sources of PmWiki indicating all markups resulting in HTML block elements[1] or in other words multiple paragraphs and other content.
- Forms
- paragraphs
- indent/outdent
- lists
- list items
- headings
- divisions and semantic HTML5 elements
- images
- pre
- tables
WikiStyles can be applied to blocks, else you don't need to bother about "blockmarkup" as a PmWiki user.
Division blocks
Division<div>
HTML blocks are inserted with the (:div:)...(:divend:)
markup. You can have the HTML id=
and class=
attributes like (:div id=id1 class="class1 class2":)
. A (:div:)
markup automatically closes a previously open such tag. To have nested tags, you need to number the tag, and the matching tag end: (:div:) Outer block (:div2:) Inner block (:div2end:) (:divend:)
Semantic HTML5? elements
Since version 2.2.75, PmWiki allows the inclusion of a few semantic HTML5? elements. Note that an opening semantic markup automatically closes any previously opened tag of the same type, but does not verify or tidy the structure for you, so make sure you use closing tags when needed.
(:article:)...(:articleend:)
- Inserts an <article> tag. You can have the HTML
id=
andclass=
attributes like(:article id=id1 class="class1 class2":)
. An(:article:)
markup automatically closes a previously open such tag. To have nested tags, you need to number the tag, and the matching tag end:(:article:) Outer article (:article2:) Inner article (:article2end:) (:articleend:)
(:section:)...(:sectionend:)
- Inserts a <section> tag. You can have the HTML
id=
andclass=
attributes like(:section id=id1 class="class1 class2":)
. A(:section:)
markup automatically closes a previously open such tag. To have nested tags, you need to number the tag, and the matching tag end, like the(:article:)
markup. (:header:)...(:headerend:)
- Inserts a <header> tag. You can have the HTML
id=
andclass=
attributes like(:header id=id1 class="class1 class2":)
. A(:header:)
markup automatically closes a previously open such tag, and it is not possible to nest such tags. (:footer:)...(:footerend:)
- Inserts a <footer> tag. You can have the HTML
id=
andclass=
attributes like(:footer id=id1 class="class1 class2":)
. A(:footer:)
markup automatically closes a previously open such tag, and it is not possible to nest such tags. (:aside:)...(:asideend:)
- Inserts an <aside> tag. You can have the HTML
id=
andclass=
attributes like(:aside id=id1 class="class1 class2":)
. An(:aside:)
markup automatically closes a previously open such tag, and it is not possible to nest such tags. (:address:)...(:addressend:)
- Inserts an <address> tag. You can have the HTML
id=
andclass=
attributes like(:address id=id1 class="class1 class2":)
. An(:address:)
markup automatically closes a previously open such tag, and it is not possible to nest such tags. (:nav:)...(:navend:)
- Inserts a <nav> tag. You can have the HTML
id=
andclass=
attributes like(:nav id=id1 class="class1 class2":)
. A(:nav:)
markup automatically closes a previously open such tag, and it is not possible to nest such tags. (:details summary="Summary":)...(:detailsend:)
- Inserts a <details> and embedded <summary> section. Standard-compliant browsers will only show the summary, and the user can click on it to open the full section, without a need for JavaScript?. A
(:details:)
markup automatically closes a previously open such tag. To have nested tags, you need to number the tag, and the matching tag end, like the(:article:)
markup. This is a recent addition to the HTML5? standard, see https://caniuse.com/#feat=details for current browser support (browsers that do not support it show the section open).
(:details summary="Click for more information...":) Here is the content of the <details> section. (:detailsend:) |
Click for more information...Here is the content of the <details> section. |
- To have a details section open by default, add the attribute
open=open
like(:details open=open summary="Summary":)
See also
- BlockMarkup-Talk This page covers discussion about the BlockMarkup character combinations
- BlockMarkup Markup resulting in paragraphs
- CharacterMarkup inline markup character combinations summary
- CommentMarkup various forms of comments and how to achieve them for wiki pages
- ConditionalMarkup The if directive allows portions of a page to be included or excluded from rendering
- CustomMarkup Using the Markup() function for custom wiki syntax; migration to PHP 5.5
- LineMarkup Start of Line wiki markup
- MarkupCharacters A list of special characters used in PmWiki markup
- MarkupExpressions String and formatting operations
- Markup Master Index Tabulation of all PmWiki markup
- MarkupVariables redirects to Page variables
- Table directives Directives for table processing
- Tables Simple tables with double pipe markup, one row per line
20 PmWiki.BlockMarkup-Talk
This is a talk page for improving BlockMarkup.
Block marking
>>X Y<<
is a shortcut for "(:div:)%div X Y apply=div%
" [2].
A block can be marked as follows
>>wiki style<<
>>change in wiki style<<
>><<
and continues until the wiki style changes or empty brackets are encountered. A block cannot be nested using this markup, but a block can contain a table or the following markup.
A block can be marked as follows
(:div class="c1 c2" style="atr1:z;atr2:y;":)
(:divend:)
Blocks can be nested by naming (with numbers) the blocks, viz
(:div5 class="c1 c2" style="atr1:z;atr2:y;":)
(:div2 class="c1 c2" style="atr1:z;atr2:y;":)
(:div2end:)
(:div5end:)
(:div2:) %div rframe% How do I use rframe in a block? (:div2end:) [[<<]] (:div class="rfloat frame":) How do I use rframe in a block? (:divend:) | How do I use rframe in a block?
How do I use rframe in a block? |
A block can also be a table.
Text wraps, joins and breaks
Text on two lines in a row will wrap and fill as needed (the normal HTML behavior).
Text on two lines in a row will wrap and fill as needed (the normal HTML behavior). | Text on two lines in a row will wrap and fill as needed (the normal HTML behavior). |
To turn off automatic text filling, use the (:linebreaks:)
directive above the paragraph.
(:linebreaks:) Text on two lines in a row will wrap and fill as needed (the normal HTML behavior). (:nolinebreaks:) | Text on two lines in a row
|
Use \
(backslash) at the end of a line to join the current line to the next one.
Use \ (backslash) at the end of a line \ to join the current line to the next one. | Use \ (backslash) at the end of a line to join the current line to the next one. |
Use \\
(2 backslashes) at the end of a line to force a line break.
Use \\ (2 backslashes) at the end of a line \\ to force a line break. | Use \\ (2 backslashes) at the end of a line |
Use \\\
(3 backslashes) at the end of a line to force 2 line breaks.
Use \\\ (3 backslashes) at the end of a line \\\ to force 2 line breaks. | Use \\\ (3 backslashes) at the end of a line |
Use [[<<]]
to force a line break that will clear floating elements.
Use [[<<]] to force a line break that will clear floating elements. | Use |
Preformatted blocks
The [= and =]
markup can be applied to multiple input lines, including empty lines. This makes it useful for displaying lines of code, which will be shown as monospaced font and not interpreted by PmWiki. Just leave an empty space in front of the opening [=
, and finish with a closing =]
. If there are [=...=]
pairs in the code, put a =][=
after each =]
. For example:
[= Code goes here like [[PmWiki.PmWiki]] $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]=][='; #just some code =] | Code goes here like [[PmWiki.PmWiki]] $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'; #just some code |
The same effect can be achieved using the [@...@] syntax; in this case you don't need a leading space or the extra =][= markup.
[@ Code goes here like [[PmWiki.PmWiki]] $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'; #just some code @] | Code goes here like [[PmWiki.PmWiki]] $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'; #just some code |
It is also possible to use [= ... =]
within other wiki structures, which enables the inclusion of new lines in text values. The example below shows how to include a multi-line value in a hidden form field.
(:input hidden message "[=Line1 Line2=]":)
The "pre" style can also be applied
>>pre<< This style preserves white space, and [[(Wikipedia:)newline]]s. >><< | This style preserves white space, and newlines. |
Note that it does not cause the text to be displayed in a monospaced font.
See also
More advanced formatting can be achieved with wiki styles and page directives.
Headings in summary
The detail's summary allows heading content, but !! etc do not appear to work. Is it possible to permit headings in the detail summary in PmWiki?
Not at this point, see PmWiki philosophy #2 "PmWiki doesn't make any attempt to do everything that can be done in HTML." --Petko June 23, 2020, at 11:11 AM
Is BlockMarkups finalized, DocumentationIndex does not have a link to it ?
VKrishn
[[#test1]] >>frame<< !! {$$PageCount} {=$FullName} >><< (:include {=$FullName} lines=2..:) [[#test1end]] [[#test2]] # {=$FullName} [[#test2end]]