The blockquote plugin creates semantically correct quotes by using the blockquote XHTML tag. In contrast to the default wiki markup for quoting, the content of the quote can contain any wiki markup which then gets interpreted as it would outside of the quote environment. Thus, also nested quotes are possible.
The plugin provides two additional pairs of markup tags, the blockquote
and the cite
markup. The blockquote
allows an additional citation source to be given after the blockquote
keyword in the opening tag. The cite
markup was mainly created to allow the addition of more complex citation sources (including links, text formatting etc) inside the blockquote
environment, although it can also be used standalone. See the examples below.
The following code
<blockquote> Test with loads of markup... Another paragraph with a little [[http://nowhere|link]] to nowhere. Oh, and while we are at it, what about some **bold**, some //italic// and some __underlined__ text? And finally, an itemization: * item 1 * item 1.1 * item 1.2 * item 2 - ordered item 2.1 - ordered item 2.2 - ordered item 2.2.1 * item 3 Works :-) </blockquote>
results in
Test with loads of markup…
Another paragraph with a little link to nowhere. Oh, and while we are at it, what about some bold, some italic and some underlined text? And finally, an itemization:
item 1
item 1.1 item 1.2 item 2
ordered item 2.1 ordered item 2.2
ordered item 2.2.1 item 3Works
![]()
The following code
<blockquote J. Random Hacker>Test with a cite attribute...</blockquote>
results in
Test with a cite attribute…
The following code
<blockquote>Test with a cite command...<cite>J. Random Hacker, [[http://localhost/~jrhacker]]</cite></blockquote>
results in
Test with a cite command…J. Random Hacker, http://localhost/~jrhacker
The bookcreator plugin allow to select some pages from wiki and export to create a little book PDF or text (like a similar function of Wikipedia)
The component for syntax, displays the list of pages selected for exporting and manage selections; the component for action, handle the selection by a add/removing pages, show a toolbar (like a similar toolbar of Wikipedia).
On the list of selected pages, You can use drag and drop to change the order, save your selection for restore in a second time or share with other users.
To work, this plugin needs cookies; the PDF export required dw2pdf plugin; the TEXT ONLY export required text plugin.
To use this plugin, use these two simple ways:
~~BOOK~~
or
~~ARCHIVEBOOK:number&sort~~
in the page 'wiki:ebook' (create it first).
With ~~BOOK~~ You can show and manage your list of selected pages
With ~~ARCHIVEBOOK:number&sort~~ You can show a list of saved selections (books) anywhere into your wiki
Optionally you can specify the number of selections to display and the order. Default is 10 items ordered by date (first last updated). Each of selection is linked to book's page for it.
To add or remove a page to selection, you simply need to call the page passing it a “do=addtobook” PHP argument. The easiest way to implement this is to add a button or similar somewhere in your template design.
Use the following to add another button in the upper or bottom button row of the default template1)
Highlight particularly important parts of your wiki in boxes that stand out with Box Plugin.
A simple box:
<box> the box contents </box>
Some more complex boxes
<box 80% round orange|a title> the box contents</box>
a title
<box 50% left blue>the box contents</box|a caption>
a caption
<box 60% round #f99 #fc9 #fcc #f60|title>the box contents</box|caption>
title
caption
<box width classes colours | title text> contents text </box>
if no classes are specified the default styles will be used, that is square corners in a colour scheme based on the default DokuWiki colour scheme.
#F00 #fcab94 rgb(255,255,0)
. The colours are applied in order to:
if less than four colours are specified, the first colour is used for the missing colours.
The opening <box … >
including the title must all appear on one line. The box contents can appear over as many lines as are needed.
See the plugin in action here. The sample page shows all the styles available with the plugin.
a title
'let us start a quote and not finish it.
Boxed & titled
using hex colours
using rgb colours
The bottom credits goes here (if only I could align this right)
boxed & captioned
title with forma
tting, a link and rounded corners
<div class='box'> <b class='xtop'><b class='xb1'></b><b class='xb2'></b><b class='xb3'></b><b class='xb4'></b></b> <div class='xbox'> <p class='box_title'>Title text would go here</p> <div class='box_content'> <p>Including this html snippet of a box</p> <p>All those <b> tags handle the rounded corners</p> </div> </div> <b class='xbottom'><b class='xb4'></b><b class='xb3'></b><b class='xb2'></b><b class='xb1'></b></b> </div>
=== headings aren't allowed in boxes ===
but | tables | are |
and plugins … ; definition : list : list : list
and a link
Wow, a lot of stuff
title
Example box
looks good?
title
title
title
title teste
title test
title teste
title test
Is the colour wrong?
title test
Simple box with rounded edges and title
Yes! there can!
* I will have to check this out * tomorrow * on my wiki
* I will have to check this out * tomorrow * on my wiki
Boxes in boxes works but will create another line per box, an inline option would be nice.
This is the parent
this is a child
this is another child
This is the parent
this is a child
this is a nested child
This plugin can help your team to schedule meetings or making other decisions in a team. The syntax looks like this:
<btable [id]> <columns> ^ [column] ^ [column] ^ ... ^ </columns> <rows> ^ [row] ^ [row] ^ ... ^ </rows> </btable>
That means, you can simply put a <btable>
tag on the page and gets a fully selectable boolean table with export functionality.
[id] | the ID of the btable; must be unique2); appears as title | required |
---|---|---|
[column] | an option for which users can tick a checkbox whether it's 'true' or not ('false') | required |
[row] | an option which users can select from a combobox to insert boolean values for it | required |
<btable Test>
<columns> Person A ^ Person B ^ Person C ^ Person D ^ Person E </columns> <rows> 10-10-2007 ^ 17-10-2007 ^ 24-10-2007 </rows>
</btable>
<btable Test Double>
<columns> Person A ^ Person B ^ Person C ^ Person D ^ Person E </columns> <rows> 10-10-2007 ^ 17-10-2007 ^ 24-10-2007 </rows>
</btable>
The bureaucracy plugin allows you to create an HTML form right within DokuWiki. Input format validation is automatically handled by the plugin and requires no coding. User input can be emailed to a preconfigured address or used to create new pages using a template.
On an open wiki, you might want to use the CAPTCHA plugin to avoid automated spam. When it is installed, Bureaucracy automatically integrates the captcha check in its form submission handling.
The SMTP plugin may help when your DokuWiki can't send mails.
When you use Bureaucracy's template action, you can add in the template a dataentry of the Data plugin that structures and stores your information for good accessibility, whereas the dataentry you can use placeholders of bureaucracy to place information from the form.
The recent Struct plugin draws heavy inspiration from the data plugin and allows for central management of wanted structured data while keeping the functionality of the data plugin. The struct plugin supports integration with the Bureaucracy Plugin. This allows reusing the input mechanisms of the different types in Bureaucracy forms and creation of structured data when pages are created through Bureaucracy's template action.
An additional plugin to look at is pagemod, which adds a pagemod
action for the Bureaucracy plugin to add data to an existing page (in addition to the current templating and mailing functionality)
The Data plugin can not only be useful in templates as mentioned above, but it also provides a data_aliastextbox
field that lets you create fields with types and type aliases of the data plugin. Some of these types have a nice layout e.g. pagesuggestions or listing using predefined options from type aliases. See example.
With Struct plugin, you can use any field from any defined schema as a field in a bureaucracy form. You can also add a whole schema to the form.
Without the CAPTCHA, this plugin should only be used on closed wikis, because it could easily be abused as a spam gateway.
Let's start with an example:
<form> Action mail me@example.com Thanks "Thanks for submitting your valuable data." Fieldset "A set of fields" Textbox "Employee Name" "=Your Name" number "Your Age" >13 <99 email "Your E-Mail Address" textbox "Occupation (optional)" ! password "Some password" fieldset "even more fields" select "Please select an option" "Peaches|Apples|Oranges" static "Some static text that could be an agreement" yesno "Read the agreement?" textarea "Tell me about your self" textbox "You need to write 'agree' here" /^agree$/ submit "Submit Query" </form>
As you can see, you can define a email address where the data should be sent to and a thank you text to be shown when a user submitted the form. What follows are the various fields to fill in.
fieldset
s and the submit
button, the label is optional.
select
type, need a third parameter.
"S p a c e s"
"
by using ""
e.g. "With ""quotes"" in the string"
The plugin takes care of validating the form, the field types, and set constraints.
mail
, template
, script
.pagemod
or struct_lookup
.
mail
:
template
:
_
to try and use the target namespace template (use an absolute path) (required)
script
:
conf/plugin/bureaucracy/
directory
@@
marks emailadress as Reply-To address for mail action
x23
) (optional)
"=true value" "!false value"
). If only used for a fieldset the default values are not required.
|
char "Peaches|Apples|Oranges"
)
|
char "Peaches|Apples|Oranges"
)
multiselect “Label” “Opt1|Opt2|Opt3” =Opt1,Opt3
,
” in e-mail message
,
” or you can provide optional separator: @@Label(separator)@@
|
char "Peaches|Apples|Oranges"
)
"=some value"
)
<code html>..</code>
and <code text>..</code>
at the template page is used in the email of the mail action, instead of default table with field values.
page_tgt
based on a template page page_tpl
new:destination
, then addpage will try to add new:destination:page_tgt
action
field a !
is given as template, that template is skipped and only template(s) added by addpage
are used.
.
and ..
can be used to reference namespaces relative to the new page. Defaults to .
_
for type of field, using dataplugin type syntax
>
followed by a number to require numeric data bigger than the given number
<
followed by a number to require numeric data smaller than the given number
=
to set a default value, you can also use placeholders here
!
char to make a field optional
^
char to give a field the focus (possible for only one field at a page)
@
char to make its value be used for the pagename in template mode (the value will be appended to the pagename, separated by an underscore)
@@
to mark the value of a field as Reply-To address for mail mode
0000
for a number field, for completing inputted values with leading zeros upto the same length
++
for a number
field to make it auto-increment the counter on each form submit.
/
chars to require the the regexp to match before the field is accepted (case insensitive). Examples (for additional information see below):
/^[^\/:]+$/
nice for pagenames, the chars /
and :
aren't allowed
/^[0-9 \/()+\-]+$/
nice for phone numbers, allows only numbers and the chars ()-+/
**Message
. Example:
textbox "Your pagename" /^[^\/:]+$/ "**Don't use / or : in your page name"
_
to define type alias.
A regular expression is used to define a pattern of text. In its simplest case (as used here) if the pattern can be found then the text is accepted, if the test fails then the text is rejected. Under bureaucracy, when the submit button is pushed text boxes are compared to their regular expressions. If the test passes, then submit can continue, if the test fails then submit rejects the form and asks for a correction.
The simplest possible regular expression (regex) is a single character: /a/
. This states that the input text (the string) must contain somewhere within it the letter “a”. “access” would pass, as would “backups” but “Hello World” would fail.
The regex may contain a number of characters: /abc/
which requires that the string “abc” be found somewhere. “Learn your abc” passes but “a bc” fails (there is a space between the “a” and “b”).
Frequently you want to select one of a number of characters. Square brackets group a number of alternatives together: /[abc]/
means that either “a” or “b” or “c” must occur somewhere within the string. Ranges are possible, [a-z]
means any lowercase letter. Putting things together, /rfc[0-9][0-9][0-9][0-9]/
matches any four digit request for comments such as “rfc0248” or “rfc4027”.
The brackets are called meta-characters, that is they don't represent real characters (like for instance “a”) but do affect how the string is interpreted. There are a number of meta-characters the most important of which are:
For example /^[yn]$/
means that the string must start with a “y” or and “n” and have no characters following. “y” and “n” are therefore the only possible strings. /^I[0-9]+$/
matches US interstate roads: “I12”, “I66” and so forth. Somewhat confusingly “^” has another meaning when it occurs immediately after a left bracket, it negates the contents. /[^ab]/
matches any character other than and “a” or “b”.
Looking now at the examples above. /^[^\/:]+$/
starts at the beginning of the string (“^”) accepts any character other than “/” or “:” (“[^\/:]”, note the “\” to make the “/” into a normal slash), accepts these characters 1 or more times (“+”) and then needs to see the end of the string “$”. “/home/doc.txt” fails, there are slashes present. “ puzzled ” is acceptable.
Finally /^[0-9 \/()+\-]+$/
. The whole string consists of a one or more characters (“^” to “+$”). These characters must be (“[” to “]”) numbers (“0-9”), spaces (“ ”), slashes and parenthesis (“\/” and “()”), pluses and minuses (“+\-”).
For more information:
man 7 regex
.
By default all labels are used as provided. Eg. they are displayed in the form and they are used as placeholders for the template mode. In some cases you might want to use simpler names for the fields but still have more extensive labels displayed in the form.
This can be achieved with defining label translations in a separate wiki page and give this page in the labels
field:
<form> action mail me@example.com labels mylabels fieldset "field" textbox "name" number "age" >13 <99 submit "submit" </form>
The translation page needs to contain a single wiki list with items named label = translation
:
* field = Tell us about yourself" * name = Your Name * age = Your Age * submit = Send your Data
The above would result in the following form:
Note: double slashes // cannot be used in the translation field on the translation page — http://forum.dokuwiki.org/u/SFITCS 2016-12-15 22:27 |
Sometimes part of a form should only be asked when a certain answer was picked for a previous question. Simple dependencies like that can be created by using Fieldsets.
Consider the following example:
<form> action mail me@example.com fieldset "Your Order" textbox "Your Name" select "What do you want" "Car|Blimp" fieldset "Car Parameters" "What do you want" "Car" number "Number of Wheels" textbox "Extras" fieldset "Blimp Parameters" "What do you want" "Blimp" select "Filling" "Helium|Hot Air" number "Size" fieldset "Payment" yesno "Can you pay right now?" fieldset "Details" "Can you pay right now?" textbox "Name" number "Amount" fieldset "Confirm Order" submit "Submit Query" </form>
In this example, a user can select to order a car or a blimp. Depending on his choice, the second or third fieldset will be hidden or shown accordingly. The second parameter for the fieldset
field references a previously defined field and the third parameter the value that field shall have to display the fieldset. Only exact matches are supported here, so best combine this feature with a select
field as shown above.
When the user marks the checkbox of the yesno
field in the fourth fieldset the fifth fieldset is shown, so the correct details can be noted. Here is no third parameter given to the fieldset, because it will check if the referred yesno field is set (It will not look for the default values eventually set by “=Value” “!Not Value”. If you need the value of the yesno in a template, you have to provide the default values explicitly.).
NOTE:
How to use dependencies to adapt a select list. Example:
First level “select” list
select "Vehicule" "Car|Motorbike"
Second level “select” lists:
fieldset "Car spareparts" "Vehicule" "Car" select "Sparepart1" "4 wheels|steering wheel"
and
fieldset "Motorbike spareparts" "Vehicule" "Motorbike" select "Sparepart2" "3 wheels|handle bar"
To show only the shown value of both select fields “Sparepart1” and “Sparepart2” in a template, use the construct
@@Sparepart1|@@@@Sparepart2|@@
The chosen one will be filled out and the not chosen one will be replaced by an empty string (“”).
Sometimes you may want to link to a bureaucracy form and pre-fill one or more fields. This can be easily achieved by adding parameters to your link using @
-wrapped field names.
Imagining the form given in the previous section is on a page called orderform
. Here is how you could link to a form for ordering Hot Air blimps:
[[orderform?@What do you want@=Blimp&@Filling@=Hot Air|Order a Hot Air Blimp!]]
Bureaucracy does three things:
The last step is where the data is processed. The action to use is defined in the action
field, as described above. Currently three modes are supported: mail
, template
, and script
. Additional modes (e.g. to store the data in a database) can easily be added.
This is a simple action. When used default, all user input will be sent by email to the configured email address. See the example above how to use it. You may specify multiple recipient mail addresses separated by commas.
Example to automate email to an address which the user enters:
Fieldset "Some Information" Textbox "Employee Name" email Email_Address Action mail @@email_address@@
usemailtemplate
you can define alternative content for the email. The template should contain two code blocks with text and html version of the message. Other text on the page is ignored. In the template you can use placeholders.
subject
field you can replace the default subject
@@
you add Reply-To address(es) to the mail.
Example:
action mail @MAIL@ forename@surname.name usemailtemplate your:template subject "new special subject"
======Mail template page====== <code html> Dear @@Your Name@@, You are <b>great<b>, you just <i>purchased</i> our @@What do you want@@! We will deliver it fast as possible, see the <a href="http://example.com/conditions">conditions</a>. Kind regards, Future Machines company </code> <code text> Dear @@Your Name@@, You are great, you just purchased our @@What do you want@@! We will deliver it fast as possible, see [1]. Kind regards, Future Machines company [1] http://example.com/conditions </code>
This action uses given pages as template, will replace defined placeholders with the user input and create wiki pages. This is a very powerful, but somewhat complex concept.
The action line looks as follows:
action template [template] [destination] [separator]
template
is
_
) as template name, the plugin will attempt to use the configured namespace template of the destination namespace.
!
skips this template, but requires at least one via the addpage
field
destination
tells bureaucracy where to create the new page[s]. This is usually a namespace (trailing colon). See section below for more detail.
separator
new page names can be created by using multiple form field values. This character defines how these should be concatenated (see method 1 of section below)
When using the template mode you need to define where resulting pages should be created. There are multiple ways to do this.
Method 1 The simplest way is to specify an output namespace and mark up your naming fields using the @
character. Here's an example:
<form> action template userstpl users: : fieldset "Create Your User Page" select "What's your Continent?" "Europe|N. America|S. America|Asia|Australia|Africa" @ textbox "What's your Name?" @ textarea "Enter a short bio" ! submit </form>
This would create a new page using the continent and name fields. Eg. if I fill in “Europe” and “Andi” for those fields, the resulting page would be users:europe:andi
.
Method 2 Sometimes you want some more control over the resulting pagename(s). This can be achieved by using placeholders in the destination parameter and omitting the @
marker in the field definitions.
Placeholders are the field names surrounded by @@
characters. Additionally any strftime parameters can be used. Let's have another example:
<form> action template userstpl "users:%Y:@@What's your Name?@@:start" fieldset "Create Your User Page" select "What's your Continent?" "Europe|N. America|S. America|Asia|Australia" textbox "What's your Name?" textarea "Enter a short bio" ! yesno "Do have publication?" fieldset "Add your publications" "Do have publication?" textarea "Publications:" addpage users:publicationtemplate publications fieldset "Finish" submit </form>
The above would create a namespace based on the current year and my name and create a start page within it: users:2012:andi:start
Method 3 When working with Dependencies with Fieldsets you might want to add additional pages when a fieldset is shown, but skip the page when the fieldset is hidden. This can be achieved with the special addpage
field.
Just put it in the fieldset of question:
addpage additionaltpl somepage
The second fieldset from the example above adds a publication page, via a checkbox. Here the template for additional page is located on absolute path: users:publicationtemplate
.
Only when the yesno
field is checked, the additional page is created on users:2012:andy:start:publications
The templates need to contain the same fields as your form, and some other placeholders are available too. Some of them can be used as default values for form fields:
Placeholder | action |
---|---|
@@Field label@@ ##Field label## | Will be replaced by the actual values the user filled into the form. |
@curNS(arg)@ @getNS(arg)@ @noNS(arg)@ @p_get_first_heading(arg)@ | Will be replaced with a result of the corresponding dokuwiki function. arg can be both a static value, eg. @curNS(some:test:value)@ or the placeholder of a field, eg. @p_get_first_heading(@@field@@)@ . |
@@Field label|Nice alternative@@ | For empty field the text Nice alternative is shown |
@NSBASE@ | (only template action) Namespace that contains new page. eg. if the new page is foo:bar:baz:bang , @NSBASE@ will contain baz |
%Y %F %a %Y-%m-%d %s… etc | strftime parameters to refer to current time |
%% | Replaced by % char, needed to avoid accidental timereplacements in your template. |
@DATE(<datetime>,%%Y-%%m-%%e)@ @DATE(<datetime>)@ | Accepts different datetime formats, which are outputted in the requested strftime format. Providing no format returns date with format of the config:dformat setting. |
@ID@ @USER@ @MAIL@ … etc | DokuWiki replacement patterns for templates are available too |
@FORMPAGE_ID@ @FORMPAGE_NS@ @FORMPAGE_CURNS@ … etc | Works like replacement patterns but refers to the page with the form |
@YEAR@ , @MONTH@ , @DAY@ , @TIME@ , @TIMESEC@ | Print current: year, month, day, time as hh:mm and time as hh:mm:ss |
@TABLEHTML@ , @TABLETEXT@ | (only mail action) html or text table of all field values |
<noinclude>…</noinclude> | Tags with their content are removed |
<noreplace>…</noreplace> | The content between <noreplace>…</noreplace> is preserved without performing any replacements but tags itself are removed. |
@LANG@ | Languagecode as configured |
@TRANS@ | Languagecode obtained from page id of form |
For the userstpl
from the example above, you could have the following page:
====== @@What's your Name?@@ ====== I'm living in @@What's your Continent?@@. I'm a user since %Y-%m-%d. @@Enter a short bio|FIXME please fill in your biography@@
The result then would look somewhat like this with all the user data filled in:
====== Andreas Gohr ====== I'm living in Europe. I'm a user since 2007-12-23. It's me :-)
By default this plugin will check for ACLs in template mode using the permissions of the user filling the form. This means the user needs to have at least read
permissions for the template and create
permissions for the namespace where the new page should be saved.
However sometimes you may want to give anonymous users a way to create pages in a restricted namespace without giving them any direct access. This is where the runas
option comes into play. With this option you can specify a username in the config manager. The user you specify here will always be used for checking the permissions mentioned above, regardless of the user filling the form. This way you can specify the needed access for this particular virtual user in the ACL manager.
Note: the runas
user does not need to exist. In fact it is recommended to use a non existing user. Even when it exists, permission checks are done on user level only, groups of the user will be ignored.
When using a user
or users
field, additional data of the selected users can be used in the template:
This action gives the data to a PHP script supplied by the administrator. The script then can do whatever it wants with the data.
The script must be placed in conf/plugin/bureaucracy/
directory. It must contain one class that is named helper_plugin_bureaucracy_handler_scriptname
and implements the interface dokuwiki\plugin\bureaucracy\interfaces\bureaucracy_handler_interface
That means the class has to have the handleData($fields, $thanks)
method with the fields and the thanks-message as parameters. It returns a thanks-message on success or false
on error.
This is a simple script handler that will just print the form's arguments in DokuWiki's debug log.
<form> action script example.php textbox "Type something" submit "Write to log" </form>
<?php use dokuwiki\plugin\bureaucracy\interfaces\bureaucracy_handler_interface; class helper_plugin_bureaucracy_handler_example implements bureaucracy_handler_interface { /** * Log the form fields to DokuWiki's debug log */ public function handleData($fields, $thanks) { dbglog($fields, __FILE__ . ': ' . __LINE__); dbglog($thanks, __FILE__ . ': ' . __LINE__); return $thanks; } }
Example code for checkbox field:
yesno "Are you happy?" "=Yes sir" "!No sir" yesno "Show fieldset?" fieldset "Shown on checking the box" "Show fieldset?" textbox "Share your praise"
Yes sir
for checking the field, and No sir
for unchecking. Leaving out default value(s) does result in no return value.
yesno
field, no third argument is needed, instead it checks if the yesno
is set. No default values are required for yesno
where the fieldset depends on, unless you like a return value to your mail or template from that yesno
field of course.
number "One" number "Two" ++ number "Third" >3 <40 hiddenautoinc "Four (notice: conflicts with Two)" number "Fifth" 000 number "Sixth" ++ 000
number
field. So don't combine in one form.)
To add a new type, you need to implement a Helper Plugin inheriting from helper_plugin_bureaucracy_field
. There you probably want to overwrite the renderfield()
method and probably some other methods as well. Your field will automatically be available as type <plugin>_<component>
. Eg. lib/plugins/foo/helper/bang.php
creates a new type foo_bang
.
If you need more control over adding one or more fields, you can implement an Action Plugin hooking to PLUGIN_BUREAUCRACY_FIELD_UNKNOWN
. This event only has a BEFORE
event and provides the following data:
$data = array( 'fields' => &array(), // the fields initialized so far - add yours here 'args' => array() // the tokenized line, args[0] should be your plugin );
In your handler you need to check that args[0] is the field type you want to register. If it is, you need to call preventDefault()
and add your own field(s) to the fields
array. The added field has to be a descendant of helper_plugin_bureaucracy_field
!
To add a new action create a new Helper Plugin inheriting from helper_plugin_bureaucracy_action
. This works similar to adding a new field described above.
Theres is also an Event you can hook called PLUGIN_BUREAUCRACY_ACTION_UNKNOWN
. Again, there's only a preventable BEFORE
event.
describe passed data in detail. For now check the source.
Saving the final page in template mode triggers an event called PLUGIN_BUREAUCRACY_TEMPLATE_SAVE
. In the before mode you can prevent saving the page or modify it's content. The after event is triggered after a page has been created.
Passed data:
$data = array( 'patterns' => &array(), // list of PREG patterns to be replaced 'values' => &array(), // values for the above patterns 'id' => string, // ID of the page being written 'template' => &string, // the loaded template text 'form' => string, // the page the bureaucracy form was on 'fields' => helper_plugin_bureaucracy_field[], // all the fields of the form );
The event PLUGIN_BUREAUCRACY_EMAIL_SEND
gives developers of other plugins access to the submitted form data before it is actually sent in the actionmail.php
.
This makes it easier to provide custom fields in bureaucracy emails.
The event data includes the form fields info and all the values, so they can be processed by third-party plugins:
$evdata = [ 'fields' => $fields, 'values' => &$this->values ];
Important! These are hacks - there is no guarantee they'll always work, and they will not survive updates.
If it breaks you get to keep the pieces.
NOTE: The configuration setting for the PHP strftime function in /conf/dokuwiki.php
also need to be changed (can also be changed via Admin→Configuration)
$conf['dformat'] = '%d/%m/%Y %H:%M';
To change the default date format from yy-mm-dd
to dd-mm-yy
(e.g. for Australia)
Change the jQuery datepicker format /plugins/bureaucracy/script/datepicker.js
from:-
/** * Init datepicker for all date fields */ jQuery(function(){ jQuery('.bureaucracy__plugin .datepicker').datepicker({ dateFormat: "yy-mm-dd", changeMonth: true, changeYear: true }); });
to this:-
/** * Init datepicker for all date fields */ jQuery(function(){ jQuery('.bureaucracy__plugin .datepicker').datepicker({ dateFormat: "dd-mm-yy", changeMonth: true, changeYear: true }); });
Change the Bureaucracy error message in /bureaucracy/lang/en/lang.php
from:-
$lang['e_date'] = '"%s" needs to be a valid date in the format yyyy-mm-dd.';
to this:-
$lang['e_date'] = '"%s" needs to be a valid date in the format dd-mm-yyyy.';
Change the Bureaucracy date validation in /bureaucracy/helper/fielddate.php
from:-
* Validate field input * * @throws Exception when empty or wrong date format */ protected function _validate() { parent::_validate(); $value = $this->getParam('value'); if (!is_null($value) && !preg_match('/^\d{4}-\d{2}-\d{2}$/', $value)) { throw new Exception(sprintf($this->getLang('e_date'),hsc($this->getParam('display')))); } } }
to this:-
* Validate field input * * @throws Exception when empty or wrong date format */ protected function _validate() { parent::_validate(); $value = $this->getParam('value'); if (!is_null($value) && !preg_match('/^\d{2}-\d{2}-\d{4}$/', $value)) { throw new Exception(sprintf($this->getLang('e_date'),hsc($this->getParam('display')))); } } }
As of release 2016-03-11 it is also necessary to change this:-
if(preg_match('/^(\d\d\d\d)-(\d\d?)-(\d\d?)$/', $value, $m)) {
to this:-
if(preg_match('/^(\d\d?)-(\d\d?)-(\d\d\d\d)$/', $value, $m)) {
— http://forum.dokuwiki.org/u/SFITCS 2016-11-26 01:16
Now packaged as a plugin - plugin:bureaucracy-au — http://forum.dokuwiki.org/u/SFITCS 2017-03-10 08:23
To allow inserting DokuWiki code into the Thankyou field.
Change the syntax in bureaucracy/syntax.php
from:-
$thanks .= '<p>' . $thanks_string . '</p>';
to this:-
$thanks .= p_render('xhtml',p_get_instructions($data['thanks']),$info);
Which then allows the use of a link back to the same page when processing a Bureaucracy form:-
Thanks [[$examplepage|Continue]]
NOTE: If form creates a data plugin edit table the wiki code needs to be quoted (surrounded by “ ” quotes as in the example below)
Thanks "[[$page|Continue]]"
Please report bug or feature request on the Github bugtracker.
This is a simple plugin that will display CSV data in table form. The data can either be inline between <csv>
and </csv>
or be read from a file in the media area using <csv namespace:test.csv></csv>
. You can also give an HTTP URL to a CSV file instead of an uploaded media file.
If you are planning to use csv files in the media area, you will most likely need to include the .csv file extension in mime.local.conf so you can upload .csv files. Something like this should get you started:
csv text/csv
The <csv>
tag allows for additional options to be specified as well as a file reference.
Option | Description | Default value |
---|---|---|
file=<filename> | where <filename> can be any <namespace:file.csv> or <http url> | |
hdr_rows=<n> | Format the first <n> rows of data from the CSV as column headers | 1 |
hdr_cols=<n> | Format the first <n> columns of each row as column headers | 0 |
span_empty_cols=[01] | Create colspans for each empty (two adjacent commas) cell following a cell with content | 0 |
delim=<char> | The delimiter used between cells. Specify tab for a tab separated file. | , |
Other options of the form <key>=<value> are possible but not used for displaying csv data yet.
Cells that include a comma as part of the data are expected to be contained between double quotes, which is the typical behaviour of most systems when exporting .csv files.
Empty lines in the csv file or data are displayed as horizontal separators in the table.
The HTTP URL can be a shared Google Docs Spreadsheet. The following explains how to export a spreadsheet in CSV format via a URL.
To link to a Google spreadsheet:
Outline of steps adapted from:
Search and install the plugin using the Extension Manager. Refer to :Plugins on how to install plugins manually.
Simply drag and drop a file from your filesystem into the editarea of your page to upload it into the current namespace. If the file already exists you will be given the option to skip, overwrite or rename it.
This Plugin integrates well with the filelisting plugin. If you have both, then you can drag'n'drop files into the file explorer of the filelisting plugin.
insertFileLink
: Insert a link to every successfully uploaded file at the current cursor position. Deactivated by default.
Releases:
SEE Move Plugin
plugin:EditX moves or renames pages with their entire edit history, and will also delete pages with or without deleting the edit history.
Move moves a page and all histories to the targeted name, leaving a redirection text on the old page. The move summary will be left in the source page history, the target page history, recent changes, and will be sent to the subscribers or the source of the target page.
If the target page exists or has a conflicting file (page, meta or attic files), the move cannot be done. Therefore if you move a page from A to B, you cannot move B back to A until you delete (no history) page A via this plugin or manually.
If you want to perform a move without leaving a redirection and a note in the history, just check the checkbox No redirect, the source will be totally removed just as delete does.
Delete removes all files in pages/ meta/ and attic/ related to the page, except .mlist. The delete summary will be left in the source page history, recent changes, and will be sent to the subscribers of the source page.
If no delete history is checked, there will be no history in the source page but still in the recent changes.
Here are configs in the configuration manager:
The filelist plugin provides a syntax for adding linked and sorted lists of files as selected by wildcard based glob patterns to a wiki page and thus allows dynamically including file listings of arbitrary filesystem locations and media namespaces. Using the additional filename command, one can also add a single link to a file out of a list anywhere in the text, which can be used to automatically keep download links for software releases up to date with the most recent upload.
The filelist plugin provides two new commands to be used in wiki pages, filelist
and filename
. The general command syntax for both is the following:
{{[ command ]>[ pattern ][ parameterlist ]}}
filelist
or filename
.
.txt
in the folder some/path/
3), you would use some/path/*.txt
as the pattern (and the parameter direct=1
, see parameters below). Analogue to this, to include all jpeg media files in :some:namespace
, you'd use :some:namespace:*.jpg
.
&
separated parameters (defined as key-value-pairs). For a list of supported parameters, see below.
The filelist plugin supports both absolute as well as relative paths into the filesystem or Dokuwiki media namespaces. All paths are checked against a whitelist of allowed paths for scanning (as defined via the configuration setting ''allowed_absolute_paths''). Paths which are not located below these whitelisted paths are not allowed for globbing and thus filelist/filename calls to such paths fail. Per default, the Dokuwiki basedir as defined in DOKU_INC is included in this whitelist and mapped to the Dokuwiki base-URL, DOKU_URL.
Relative paths into the filesystem are interpreted relative to the Dokuwiki basedir. Relative media paths (without a leading :
that is) are interpreted relative to the namespace of the currently active page. Thus, :snippets:dokuwiki:*
and *
would be interpreted the same on the current page :snippets:dokuwiki:filelist
.
Name | Description | Possible values | Default |
---|---|---|---|
direct | Whether to interpret the given pattern as a direct path in the file system or as an dokuwiki media id. Defaults to media id. | 0 or 1 | 0 |
sort | The property by which to sort the internal file list. By default, the file name is used, with upper case being sorted before lower case (use iname for a case insensitive sorting criteria). | name , iname , ctime , mtime , size | name |
order | Whether to sort the internal file list ascending or descending. Sorting in ascending order is the default. | asc , desc | asc |
filelist specific parameters | |||
offset | The offset in the internal file list from which on to display the list. Default is an offset of 0 . | any numeric value | 0 |
limit | The number of files to display, beginning at index offset . A number of 0 means to display all available files. | any numeric value | 0 |
style | The style to use for display. list creates an unordered bullet list (the default), olist an ordered list, table a table view and page a heading/section based view of the selected files. | list , olist , table , page | list |
tableheader | Whether to show the table header describing the table columns. Off by default. | 0 or 1 | 0 |
tableshowdate | Whether to show the file modification date in the table view. Off by default. | 0 or 1 | 0 |
tableshowsize | Whether to show the file size in the table view. Off by default. | 0 or 1 | 0 |
recursive | Whether to do a recursive file crawl starting at the defined basepath. If this parameter is set to 1 , the whitecard part of the search pattern is applied to each found subdirectory. If no files are found, the subdirectory is not included in the search result. All display styles besides table will show the result in a hierarchical structure; table will first flatten the result by prepending all found files with there subtree pathname (note that this happens before sorting). | 0 or 1 | 0 |
titlefile | The filename of a file which to lookup in each subtree if recursive is set to 1 and whose content to use as title for the directory. It will be ignored in the results of the filelisting itself. Defaults to _title.txt . Example: A _title.txt file containing “My special title” found during a crawl on the subpath my/subpath will be rendered as having the name “My special title” instead of “subpath”. | any filename | _title.txt |
filename specific parameters | |||
index | Which specific item to select for display from the internal file list. The default is the first one. | any numeric value | 0 |
{{filelist>:datasheets:*.pdf&style=table&tableheader=1&tableshowdate=1&tableshowsize=1&limit=15}}
turns into
Filename | Filesize | Last modified |
---|---|---|
abb145-300.pdf | 1.0 MiB | 2018/05/28 22:28 |
abb_circuit_breakers.pdf | 3.1 MiB | 2018/05/28 22:28 |
abb_contactors.pdf | 3.5 MiB | 2018/05/28 22:28 |
abb_lw110_lug_ext..pdf | 552.8 KiB | 2018/05/28 22:28 |
af400_dims.pdf | 165.4 KiB | 2018/05/28 22:28 |
altech-buttons.pdf | 643.2 KiB | 2018/05/28 22:28 |
altech_labels.pdf | 280.9 KiB | 2018/05/28 22:28 |
altech_switch_contacts.pdf | 448.3 KiB | 2018/05/28 22:28 |
altech_terminal_blocks.pdf | 4.6 MiB | 2018/05/28 22:28 |
atkinson_elect_uiro.pdf | 275.0 KiB | 2018/05/28 22:28 |
comap_intelicompact-nt-1.3-reference_guide_r3.pdf | 7.7 MiB | 2018/05/28 22:28 |
comap_intelicompact-nt-operator_guide_12-2011.pdf | 1.6 MiB | 2018/05/28 22:28 |
comap_mainscompact-nt-1.0-reference_guide.pdf | 3.2 MiB | 2018/05/28 22:28 |
cooper-bussmann_industrial-control_7400039.pdf | 222.6 KiB | 2018/05/28 22:28 |
crown_battery_renewable_power_products_brochure.pdf | 972.3 KiB | 2018/05/28 22:28 |
{{filelist>lib/images/*&style=list&direct=1}}
turns into
{{filelist>lib/images/*&style=olist&direct=1&recursive=1&sort=iname}}
turns into
The Gallery Plugin allows you to embed an automatically created image gallery into a page.
A basic gallery can be added by selecting a namespace like this:
{{gallery>namespace}}
All image files in the selected namespace will be added to the image gallery. Don't forget the “:” in front of the namespace.
Instead of using a whole namespace of images, you can also specify a single image – this makes most sense when combined with the lightbox mode (see below).
{{gallery>namespace:someimage.jpg}}
The created gallery can be aligned by using white space (defaults to centered):
{{gallery> namespace}} (right aligned) {{gallery>namespace }} (left aligned) {{gallery> namespace }} (centered)
Instead of a namespace, you can also give an HTTP(s) URL to any Media RSS or ATOM feed with enclosures (as produced by most photo sharing sites like Flickr). The images will then be pulled from that feed instead:
{{gallery>http://www.23hq.com/rss/schabloni}}
Note: since the question mark is used to separate the parameters (see next section) the URL can not contain any question mark. To use such a feed URL with the gallery plugin, just use one of the many short URL services like http://bit.ly.
E.g. instead of http://api.flickr.com/services/feeds/photos_public.gne?id=22019303@N00&lang=en-us&format=rss_200
use a shortened URL like http://bit.ly/HurZM
.
Additionally, to have thumbnail creation correctly working you need to set config:fetchsize big enough to get the remote images downloaded.
A number of parameters can be set by appending them with ?
character to the namespace or image. Each parameter needs to be separated with a &
character. Defaults for all parameters can be set in the config manager. If a parameter is enabled by default it can be disabled in the syntax by prefixing it with the syllable no
. E.g. the parameter cache
is usually enabled and can be disabled using the keyword nocache
. Below is a list of all recognized parameters
Parameter | Default | Description |
---|---|---|
<number>x<number> | 120x120 | Sets the size for thumbnails. Unless the crop option is set, this is a boundary box into which the thumbnail will be fitted, maintaining the correct aspect ratio. |
<number>X<number> | 800X600 | Sets the size for the linked images in direct mode. This is a boundary box into which the image will be fitted, maintaining the correct aspect ratio. Note the uppercase X . |
<number> | 5 | The number images per row in the gallery table. If you specify a 0 no table is used instead all thumbnails are added in a sequence. |
=<number> | =0 | Limits the output to the given number of images. 0 means all. |
+<number> | +0 | Skip the first number of images. Useful with the option above. |
~<number> | ~0 | Add a pagination for the thumbnails displaying the number of given thumbnails per page. 0 disables pagination. Pagination is added through JavaScript - when no JavaScript is available all thumbnails are displayed |
cache | enabled | Usually the output of the created gallery is cached. When the images in your selected namespace change, you have to manually force an update of the gallery page's cache. To disable the cache for the page showing the gallery, set nocache as option. |
crop | disabled | Make thumbnails the exact given thumbnail size big, cropping when needed. |
direct | disabled | Link thumbnails with the bigger sized images not with their detail page |
lightbox | disabled | Show images in a fancy JavaScript modal browsing window, see below for details. Setting this option automatically implies the direct mode |
reverse | disabled | Reverse the order of the displayed images |
recursive | enabled | Find images in the given namespace and all sub namespaces |
random | disabled | Sort images randomly. You might want to use nocache as well |
modsort | disabled | Sort images by file modification date |
datesort | disabled | Sort images by EXIF date |
titlesort | disabled | Sort images by EXIF title |
showname | disabled | Show filename below thumbnails |
showtitle | disabled | Show the EXIF tag Headline as title below thumbnails |
anything containing a * | jpg,gif,png images | This can be used to filter the list of files found in the given namespace. * work as simple wildcard symbol. |
Example:
{{gallery>images:vacation?image_*.jpg&80x80&crop&lightbox}}
This displays all images beginning with image_
and ending in .jpg
from the namespace images:vacation
. Thumbnails are cropped to 80×80 pixels and images will be opened in lightbox mode.
Example:
{{gallery>?crop&lightbox}}
This displays all images in the current namespace using 2 parameters. Parameterlist begins with ?
additional ones are concatenated with &
.
This mode will open the clicked picture inside the current browser window without leaving the current page4).
You can close the picture view by clicking the X button in the lower right corner or anywhere outside the picture. You can move to the next or previous image by using the arrow buttons in the lower left corner, your keyboard or by clicking the left or right side of the image.
The picture is downsized if necessary to fit into the current browser window. You can enlarge it with the expand button in the top right corner.
The following keys can be used to navigate:
Key | Action |
---|---|
→ | next image |
← | previous image |
ESC | close the image view |
If you want to show a title below the image using the parameter showtitle
it may appear that the title shown is not as you expected (e.g. einstein.jpg
instead of Albert Einstein
).
If you want to adapt the image's subtitle shown in the gallery, you have to manipulate the EXIF Tag called Headline
.
You could use the ExifTool for which even a Windows GUI exists to adapt the EXIF data to your needs.
Uploading images is beyond the scope of this plugin. Do not request any features regarding this.
data/media
directory. Keep in mind that image names need to be valid :pagenames, all lowercase, no spaces or special chars!
The gallery output is cached by default. When you add pictures later, they may not show up in the gallery: add &purge=true
to the end of the URL to clear the cache. See :caching for details.
Optionally use the nocache
parameter of the plugin (not recommended).
Problems with accessing EXIF or IPTC data in the images, should be reported as DokuWiki bugs and not for this plugin. All EXIF handling is in DokuWiki core. Currently EXIF Data is expected in UTF-8 encoding. There are some problems fetching the correct date from images, these are fixed in the current development version of DokuWiki.
When the lightbox mode doesn't work and instead images are simply opened in the same window, the JavaScript was not correctly loaded. This is most likely a Browser-Cache issue. Simply follow the steps described for fixing a similar problem with the faq:toolbar. Also make sure you don't have any conflicting plugin installed. You should not install any additional lightbox plugin.
There are different reasons why thumbnails are not created:
When no images from your feed are shown, be sure you don't have a question mark in your URL. Use an URL shortener as suggested above. Also be sure your feed URL (before shortening) starts with http:// or https:// and not with feed://. The latter is just a renamed HTTP link - simply rename it back.
As written above, you need to increase the config:fetchsize config option. Also make sure LibGD or ImageMagick are installed.
Here are a few user provided examples of the gallery plugin in use:
Be sure to read the Known Limitations and Caveats section first. Questions should be asked in the forum. Bugs and feature wishes should be reported in the issue tracker. Any comments/discussions on this page will be removed.
Include another wiki page into the current one.
{{page>wiki:syntax#Tables}}
will include the section about tables of the syntax page.
{{namespace>project_foo}}
will include all pages in the project_foo
namespace.
{{page>blog:mypage&tags&comments}}
will include the page blog:mypage
and show the tags from the tag plugin and the number of comments from the discussion plugin. Both plugins need to be installed for this example.
Simply enclose the ID of the page to be included in double curly brackets:
{{page>[id]&[flags]}} {{section>[id]#[section]&[flags]}} {{namespace>[namespace]&[flags]}} {{tagtopic>[tag]&[flags]}}
[id] | page ID of the page to include; some macros are possible; shortcuts are resolved (: , . , .. ) | required |
---|---|---|
[section] | limits the included page to a specific section and its subsections | optional; default is the whole page |
[tag] | include pages with tag topic tag, requires plugin:tag | required |
[flags] | flags delimited by & , see flags | optional |
The plugin offers four syntaxes, {{page>...}}
, {{section>...}}
, {{namespace>...}}
and {{tagtopic>...}}
.
Section is aimed more at including sections, page at including whole pages and namespace at including whole namespaces. Tagtopic includes all pages with a tagtopic
tag
.
The plugin can be configured in the DokuWiki configuration manager available in the admin menu. These settings also affect the blog plugin which uses the include plugin to generate the blog page.
noheader | Don't display the header of the inserted section |
---|---|
firstseconly | Display only the first section of the included page |
showtaglogos | Show/hide an image for the first tag (if the page has tags) |
showfooter | Show/hide page footer below the included page |
showlink | Makes the first headline of a included page/section a link to the included page/section |
showpermalink | Show/hide a permalink to the included page in the page footer |
showdate | Show/hide creation date of the page in the page footer |
showuser | Show/hide user name of the page creator in the page footer |
showcomments | Show/hide number of comments in the page footer (requires the discussion plugin) |
showlinkbacks | Show/hide number of linkbacks in the page footer (requires the linkback or backlinks2 plugin) |
showtags | Show/hide tags in the page footer (requires the tag plugin) |
showeditbtn | Show/hide edit button below the included page |
doredirect | Redirect back to original page after an edit |
usernamespace | Namespace for user pages (see showuser configuration) (default user ) |
doindent | Indent included pages relative to the section of the page they get included in |
linkonly | Display only a link instead of the whole page content |
title | Show the title instead of the page id |
pageexists | Only list page ids of existing pages (see existlink ) |
existlink | Display a link and do so only if page page-id exists |
noparlink | Don't put the link into a par environment (for inline lists) |
Simple macros are possible to serve a page on a per user or per date base. These are:
@USER@ | username |
---|---|
@NAME@ | full name of user |
@GROUP@ | first group the user belongs to |
@YEAR@ | 4-digit year |
@MONTH@ | 2-digit month |
@WEEK@ | 2-digit ISO week number |
@DAY@ | 2-digit day |
@DATE<expr>@ | use a calculated date instead of today in date macros |
<expr> in @DATE<expr>@
can be one of:
PYEAR | previous year |
---|---|
NYEAR | next year |
PMONTH | previous month |
NMONTH | next month |
PWEEK | previous week |
NWEEK | next week |
YESTERDAY | yesterday's date |
TOMORROW | tomorrow's date |
Examples:
{{page>@MONTH@:@DAY@:birthdays}}
includes the page birthdays
in namespace <month>:<day>: eg. 10:15: birthdays
for the 15th of october.
{{page>@USER@:message}}
incudes the page message
from the namespace <user> of the logged in user
{{page>foo@DATENWEEK@@YEAR@:@WEEK@}}
includes the page <weekno> from the namespace foo<year>
with next week's date e.g. foo2012:01 for the 27th of december 2011
You may use flags to override default all configuration settings:
Setting | Default | Alternative | ||
---|---|---|---|---|
firstseconly | fullpage | includes the whole page | firstseconly | includes only the first section of a wiki page |
showfooter | footer | shows a footer below the page with info about the included page | nofooter | hides the page info footer |
showeditbtn | editbtn | shows a button to edit (or create) the included page | noeditbtn | hides the edit (or create) button |
noindent | fullpage | page section and header retained on the same level as source page | noheader | strips the title from the included page |
Examples:
{{page>concept&firstseconly&footer}} {{page>mypage&noindent}}
IndexMenu allows you to insert a fully customizable index or a list of pages starting from a specified namespace.
Main | Options |
---|---|
{{indexmenu>ns[#n] [ns1[#n] ns2[#n] …] | | [js[#theme]] [tsort] … }} |
Arguments inside “[]” parenthesis are optional. The #
char is always required with related options.
Settings before the “|” separator:
Main | Action | Note |
---|---|---|
ns | Main namespace name. Index starts from here. Syntax complies with DokuWiki namespaces paths. | “.” refers to the namespace of the page containing the indexmenu syntax and not to the current DokuWiki namespace context 5) (see the context option for this feature). “..” or an empty value shows the root site namespace. |
#n | n is a number that specifies how many namespace levels to display open under the main namespace. | If it's not defined then the whole tree, till the deeper node, will be open. If 0 or 1 it'll display only nodes under the main namespace. For example: “#2” will display “root:myns1:myns2” but will keep myns2 closed thus hiding “root:myns1:myns2:myns3”. Optional. |
ns1[#n] ... nsn[#n] | A list of optional namespaces inside the main namespace. Every namespace will be opened or closed at the specified n level. Syntax complies with DokuWiki namespaces. | If n is not defined then all namespaces are open, if 0 they are closed. “.” refers to the namespace of the page containing the indexmenu syntax and not to the current DokuWiki namespace context 6) (see the context option for this feature). “..” or an empty value shows the root site namespace. Optional. |
Optional settings after the “|” separator:
Option | Action | Note |
---|---|---|
js | JavaScript render method: the index is an expandable tree menu. | Without n, all nodes are open, with it, nodes are open till n level. |
navbar | The tree opens itself automatically at the current page namespace. Useful in a navigation sidebar. | It works with or without js option. Without js option, the indexmenu page is never cached (just like the default DokuWiki index page) and the DokuWiki loading could be slower depending on the amount of child nodes displayed. |
context | Relative main namespace and optional namespaces will refer to the current DokuWiki namespace context 7) instead of to the namespace of the page containing the indexmenu syntax. Useful in a navigation sidebar. | It works with or without js option. In both cases, the indexmenu page is never cached so the DokuWiki loading could be slower depending on the amount of child nodes displayed (In js mode, when a lot of nodes are usually displayed, the max option is recommended). It automatically enable the nocookie option. |
tsort | Sort (only) pages by title. | Useful when useheading is on. By default namespaces are not sorted, you need the nsort option for this. |
dsort | Sort (only) pages by date creation (first the oldest). | By default namespaces are not sorted, you need the nsort option for this. |
msort[#meta] | Sort (only) pages by a custom metadata information. Without the meta parameter, it looks for the custom sorting number specified with the {{indexmenu_n>N}} syntax (see the below metadata-tag-syntax). meta should refer to the data structure (Array values are managed through the “:” separator, for example: “msort#date:modified). | By default, pages without metadata tag are sorted by page name (the default DokuWiki way), but you can override this behaviour adding also the tsort or dsort option in the indexmenu syntax. By default namespaces are not sorted, you need the nsort option for this. |
rsort | Reverse the sorting of pages. | By default namespaces are not sorted, you need the nsort option for this. |
nsort | Sort also namespaces according to page sort options. | To use in addition to the above sort options. tsort option will apply to headpages. |
nons | Exclude namespaces nodes from index. It shows only the pages. | Without js, the closing n namespace option prevents to display nodes below the n namespace level. |
nopg | Exclude pages nodes from index. It shows only the namespaces. | |
max#n[#m] | If initially closed, the node at n level will retrieve all its child nodes through the AJAX mechanism when opened for the first time. Optionally, the nodes after the n level can be retrieved with AJAX every m sublevels instead of in one go. | It affects the server loading and speeds up the loading of pages in DokuWiki with an high amount of pages. It works only in js. Cookie are automatically disabled, just like with nocookie. |
theme | Theme name for indexmenu icons | A theme is a set of icons inside images directory as described in theme-tutorial. Admins can download and share themes in admin panel. It works only in js |
id#[random|n] | Cookie ID for a js indexmenu where the previously opened/closed nodes by a user are stored. | Useful when a page is uncached and you don't use the nocookie option because it forces the same cookie preventing un-useful cookies created every time a page is viewed by the user. By default is always random even when this option is not specified, but you can force it to be a n fixed number ( i.e id#20 ). Read the js-does-not-remember-its-previous-state section. ATTENTION: ID must be unique for every indexmenu in your DokuWiki site or you'll get strange js behaviors. It works only in js |
maxjs#n | It sets how many js tree levels to render when page loads. Remaining nodes are rendered (slightly slower) only when they are open by users, by optional namespaces option, by cookies or by navbar option. | Default n is 1 so that it will speed up the page loading, above all with an high amount of pages. It affects only the user-client CPU speed, not the webserver load. It works only in js |
nocookie | Disable cookies. By default js indexmenu remember selected,open and closed nodes by user during navigation. With this option it doesn't remember them and the tree is blocked to its start status. | It works only in js |
noscroll | Disable the JavaScript scrolling feature. It could solve visualization problems. | It works only in js |
notoc | Disable the TOC-preview feature. | It works only in js |
A sample of an indexmenu JS index that could be used inside a navigation sidebar. Its initial status is blocked by the nocookie option, so, when the page is reloaded, it doesn't remember the open and closed nodes by the user.:
{{indexmenu>..#1|js navbar nocookie}}
JS navigation index with “thread” theme where nodes after the third level are retrieved with Ajax every 2 sublevels. Pages are sorted by title and custom sort number:
{{indexmenu>..#1|js#thread navbar max#3#2 tsort msort}}
Standard DokuWiki index showing only pages inside wiki:plugins and lower namespaces (max two levels):
{{indexmenu>:wiki:plugins#2|nons}}
Js tree showing pages and namespaces both sorted by reverse title. For example,if “archive” contains stuff (“news”,”oldnews“,etc) that you need to quickly organize by time, you could create numbered headpages for every namespace (i.e renaming “oldnews” in “news 2006”, “news” in “news 2010” and so on) and sort them from new to older:
{{indexmenu>:archive#1|js tsort nsort rsort}}
Standard index showing the tree of the current context 8) opened at the second level .
{{indexmenu>playground#2|context}}
Show all current namespace pages .
{{indexmenu>.:#1|context}}
JS tree showing all (and only) the namespaces of the “private” namespace sorted by date creation. “private” is relative and refers to the private namespace under the page containing the indexmenu syntax.
{{indexmenu>private|js nopg dsort}}
By default nodes on the same tree level are sorted by name (or by title/date if you use the tsort/dsort syntax), but you can also specify a custom sort number for every page inserting a metadata tag in the pages with this syntax:
{{indexmenu_n>N}}
Where N
is a number.
Then you need to use the “msort” option in your indexmenu tree syntax.
If you have the show_sort
option enabled in the Configuration Manager, a notice is displayed to admins (only) on every page with this metadata tag (the text defaults to “Indexmenu sort number: N”).
Examples:
You can change the order of this tree containing a mix of standard and useheading pages:
-Root |_don |_Mirror sessions (headline title of the ":mirror" page) |_pachuco |_At the radar station (headline title of the ":radar" page) |_van |_vliet
in this way:
{{indexmenu>..#1|msort}}
-Root |_vliet {{indexmenu_n>1}} |_van {{indexmenu_n>2}} |_don {{indexmenu_n>3}} |_Mirror sessions (headline title of the ":mirror" page) |_pachuco |_At the radar station (headline title of the ":radar" page)
Pages without sort number, like the last three pages, are sorted by page name as default, but you can force a different sort:
{{indexmenu>..#1|tsort msort}}
-Root |_vliet {{indexmenu_n>1}} |_van {{indexmenu_n>2}} |_don {{indexmenu_n>3}} |_At the radar station (headline title of the ":radar" page) |_Mirror sessions (headline title of the ":mirror" page) |_pachuco
MathPublish plugin.
To toggle to the math mode, you must use the <m>...</m> tag. The math commands must be separated by a space character or surrounded by {}.
<m>x in bbR \ { 1; 2 }</m>
a~b :
Syntax : matrix{num of lines}{num of columns}{first_element … last_element}
Syntax : tabular{lines description}{columns description}{first_element … last_element}
https://www.dokuwiki.org/template:navigation
http://www.jandecaluwe.com/testwiki/doku.php/navigation:intro
Put the sidebar
template directory in the lib/tpl
directory alongside the default template. Then, add the following to your conf/local.php
file:
$conf['template'] = 'sidebar';
If you want a tagline, you can define it as follows:
$conf['tagline'] = 'Your own tagline';
The content of the sidebar is defined in a page called sidebar
. You can use a sidebar
page per namespace. You have to define the page in a normal wiki way if it doesn't exist yet. (Hint: in DokuWiki, simply searching for the page makes it easy to create it.) The template searches for the sidebar page first in the current namespace, and then higher on if none was found. If no sidebar page is found, the index is displayed by default.
This plugin extends DokuWiki syntax to enable the removal of one level of section indenting.
In native DokuWiki, all the content between headings is included in a section. The indentation for a particular section corresponds to the heading it follows. DokuWiki doesn't provide a way to finish a section and move back to the indentation level of the previous section - at least not without using another heading. This plugin makes that possible.
e.g.
HEADING 1 level 1 section content HEADING 2 level 2 section content HEADING 3 level 3 section content level 2 section content HEADING 3 level 1 section content
==
The two equals signs must be on their own line.
The Pagelist Plugin – as its name says – lists wiki pages in a nice way.
Just wrap a regular unordered list of internal links with the <pagelist>
tag:
<pagelist&[flags]> * [[..:blog:|Blog Plugin]] * [[..:discussion:|Discussion Plugin]] * [[..:editor:|Editor Plugin]] * [[..:tag:|Tag Plugin]] * [[..:wrap|Wrap Plugin|This is shown in the description cell]] </pagelist>
[flags] | flags can be used to alter the appearance of the pagelist, see flags | optional |
---|
Setting | Default | Alternative | ||
---|---|---|---|---|
style | default | table with horizontal lines | table , list or simplelist | standard DokuWiki table or list style |
showheader | noheader | hide the heading row of the pagelist table | header | show the header |
showdate | date | show the creation or last modification date | nodate | hide the date |
showuser | user | show creator or contributors | nouser | hide the user |
showdesc | nodesc | hide the description | desc | show the description (from metadata) |
showcomments | nocomments | hide the number of comments | comments | show the number of comments (if Discussion Plugin is installed) |
showtags | notags | hide the tags | tags | show the tags (if Tag Plugin is installed) |
showfirsthl | firsthl | show the first headline | nofirsthl | show the page name |
rsort/sort | nosort | no sortation of pages | rsort/sort | sorts the pages (reverse) alphabetically by pagename |
<pagelist&header&comments> ... </pagelist>
This will show a list of pages with a header line and a comments column (if the Discussion Plugin is installed).
The plugin can be configured using the DokuWiki configuration manager available in the admin menu. The settings also apply to plugins which use the helper component of the pagelist plugin, like for example the archive component of the plugin:blog plugin.
style | List style (default, list, table) |
---|---|
showheader | Show table header |
showdate | Shows/hides the date column (hide, creation date, modification date) |
showuser | Shows/hides the user column (hide, creator, contributors) |
showdesc | Shows/hides a short description taken from the first paragraph of a page (hide, max. 160 characters, max. 500 characters) |
showcomments | Shows/hides comments of a page (requires the plugin:discussion plugin) |
showlinkbacks | Shows/hides linkbacks of a page (requires the linkback plugin) |
showtags | Shows/hides tags of a page (requires the plugin:tag plugin) |
sort | Sorts the pages alphabetically by pagename |
I created this plugin because I have long wished for a way to add data structured in a specific way to a page in a repetitive fashion. A clear example of this is adding data to a table. How about a form on that page which could ask the right questions and when submitted add the information submitted as an additional row at the end of the table.
When I saw the plugin:bureaucracy plugin I knew it could be done and the way that plugin is written lends itself well to extension and so here it is and it works loosely in the following way:
That's really the functionality, its quite simple.
So here are the features:
That's it.
Example Files can be found here:
Defining a form is done via the plugin:bureaucracy plugin, please check that for complete syntax. But here are the changes:
<form> action pagemod <target page/namespace> <pagemod_id> <...various fields for submit...> submit </form>
To make bureaucracy use the pagemod action, you need to add action pagemod with the following parameters:
Defining a pagemod template is done within a page with the following code:
<pagemod <pagemod_id> <params>> wiki text while will be parsed for transform tags like @@field from form@@ or ##field2 from form## the contents of this section are invisible and will not show up on this page. </pagemod> some other wiki text then some more ^ table header 1 ^ table header 2 ^ <pagemod table_adder output_before>| @@table value 1@@ | @@table value 2@@ | </pagemod>
The pagemod enclosure starts with:
<pagemod <pagemod_id> <params>>
where the following is true:
The pagemod enclosure ends with the following:
</pagemod>
and the contents are not shown when the wiki page is viewed. Translation of the contents of the pagemod enclosure is done inline with the bureaucracy plugin's template function.
Since release 2009/10/12 There also exists the concept of meta variables, they are variables that are generated by the plugin at runtime. They are the following
New meta information tag requests should be sent to me for implementation.
2010-03-20 I added a auto-increment meta tag to your plugin. I needed it for a bug tracker/feature request system. If you're interested, I'll send it to you. Just send me an email to laplix¢2010¢at$gmail$dot¢com (remove the money symbols). It is not fully tested yet (right now, I only tested it with _self) but it does what I want, so…Sounds like a useful addition.. Could you share your code here?? Cheers!
Please let me know of any bugs or issues, requests. I know a large number of people have requested a plugin like this, so I hope people find it useful.
We're using this plugin to log activity reports so I required the feature to include some non-editable runtime values like current date and user attributes in pagemod's output. I've done it this way:
13a14 > global $INFO; 32a34,41 > $patterns[] = '/(@@|##)@DATE@(@@|##)/'; > $values[] = strftime($conf['dformat']); > $patterns[] = '/(@@|##)@USER@(@@|##)/'; > $values[] = $_SERVER['REMOTE_USER']; > $patterns[] = '/(@@|##)@NAME@(@@|##)/'; > $values[] = $INFO['userinfo']['name']; > $patterns[] = '/(@@|##)@MAIL@(@@|##)/'; > $values[] = $INFO['userinfo']['mail'];
I've no experience in PHP so maybe this solution isn't optimal but it does work — Dmitry Rubinstain.
From Author : This is now possible using the meta tags described in the documentation above
This plugin rocks ! IMHO, it provides such great features that it should be advertised on the front page. I'm planning to use it as a commenting system. Would it be possible to auto-detect the current page id (like the plugin:backlinks2 plugin does) ? For example :
<form> action pagemod auto new_comment fieldset "Add your comments below" textbox "Name" select "Rate it" "Excellent|Good|Bad" textarea "Comment" submit </form>
It would save an incredible amount of time when you have to insert forms in many pages ! — Laynee 2009/10/05 16:22
From Author : This is now possible using the _self target described in the documentation above
Woohooh! The new version works like a charm ! Thank you very much :) — Laynee 2009/10/12 16:00
I used this plugin for a minimalistic guestbook. Although my wiki can be edited by everyone, I think visitors would be more willing to leave a message through a little form. See http://windhoff.net/wiki/playground/playground how it works. An javascript based alternative to this is the plugin:disqus.
====== Guestbook ====== ===== New Comment ===== <form> action pagemod _self add_comment fieldset "Write new comment" textbox "Name" /^((?!<\/nowiki>).)*$/ email "Email (optional)" /^((?!<\/nowiki>).)*$/ ! textarea "Comment" /^((?!<\/nowiki>).|\n)*$/ submit </form> ===== Comments ===== <pagemod add_comment output_after> //@@meta.date.format.r@@:// ^<nowiki>@@Name@@</nowiki> |<nowiki>@@Email (optional)@@</nowiki>| |<nowiki>@@Comment@@</nowiki> || </pagemod>
— M. 2010/04/02 03:17
Hi, I installed pagemod together with the bureaucracy plugin, but I can't get them to work. After submitting data through a bureaucracy form (e.g. the demo-page) I receive the following error:
Fatal error: Class 'syntax_plugin_bureaucracy_actions' not found in /lib/plugins/bureaucracy/actions/pagemod.php on line 7
What am I doing wrong? I tried this on DokuWiki 2009-12-25c as well as on older versions, with same error.
I've updated my installation to DokuWiki 2009-12-25c, Pagemod 2009-10-12 and Bureaucracy 2010-01-22. I now encounter the same error. I guess Pagemod needs to be updated to work with the latest versions of Bureaucracy. I reinstalled my old version of Bureaucracy (it should be this one) and now it works — Laynee 2010/02/03 18:03
Replace in the file bureaucracy/actions/pagemod.php from line 32 to 40 with that
// run through fields and prepare replacements foreach($data as $opt) { $label = preg_quote($opt->getParam('label')); $value = $opt->getParam('value'); if(in_array($opt->getParam('cmd'),$this->nofield)) continue; $label = preg_replace('/([\/\.])/','\\\$1',$label); $patterns[] = '/(@@|##)'.$label.'(@@|##)/i'; $values[] = $value; }
— Rdemont 2010/02/19
I tried both solutions above, but still remain with the same error. Something else I might be missing? — LWolf 2010/02/25
Its a type syntax_plugin_bureaucracy_actions needs to be replaced by syntax_plugin_bureaucracy_action. At least, this worked for me — Gerione 2010/3/4
I have the same big problem ! Help me please— Ph LAPEYRIE 2010/03/16 23:25
THE SOLUTION = Rdemont + Gerione. It's all right for me.— Ph LAPEYRIE 2010/03/16 23:51
From Author : Fixed, now working with the new bureacracy, thanks for the help.
Multiple forms + pagemod sections on one page (and not only, read more) do not work.
Scenario 1: I have one page (name it: materials
) with two pagemod forms and two datasets,
am311
and cm113
if that matters),
Scenario 2: I have one page with form (materials
) and two datasets with data (materials:am311
and materials:cm113
)
am311
and cm113
if that matters),
In both scenarios, data gets added to both datasets, instead of one of them (am311
or cm113
).
From Author : This is not a bug in this module, its a bug in bureaucracy. If you have multiple bureaucracy forms on a page, the result is always generated from the first's parameters (action parameters) since it doesn't set these in the form, but re-reads them from the page
From Author : This bug is fixed by redeploying bureaucracy with the file with my patch detailed here, I have mailed Andreas and asked him to include my fix in his code.
From Author : This bug appears to have been fixed, many thanks to the bureaucracy maintainer for this
Great plugin ! I use it all the time. small bug for @@meta.user.id@@ which doesn't work for me : I think it should use return $INFO['user']; instead of return $INFO['userinfo']['user'];
From Author : I cannot replicate this, both accessors work
2011-11-15 From besancon@math.jussieu.fr: I have the same bug with @@meta.user.id@@. According to http://www.dokuwiki.org/devel:environment#global_variables, you get the login name with $INFO['client'] instead of $INFO['userinfo']['user'] which is not documented at all. You have to correct file “bureaucracy/actions/pagemod.php” on line 109 by changingreturn $INFO['userinfo']['user'];to
return $INFO['client'];
I was wondering if there is a way to use the period in field names, so you could make numbered items like “1. What is your name?”, etc. (using a period currently breaks the template) The only way I'm able to do this currently is writing a static “1. What is your name?” which is followed immediately by a “Name [ ]” line, which gets really cluttered if you're trying to do something like a numbered questionnaire.
On the other hand, is there any way to show a field title like “Please enter you name”, but assign it to a variable like @@name@@ for use in the pagemod tag? I apologize if this question is better asked on the bureaucracy plugin page.— Kououken 2010/03/02
From Author : Fixed in 1.2
Hi! I am quite new to wikis, so please forward me to the right place if my question is wrong here. Is there any way to check the value of a placeholder and treat the form depending on its value? Something like “if @@name@@=='Green' then <show output of the form>”? Anna 2010/03/03
From Author : This isn't functionality I am looking at adding, because its open ended in terms of possibilities
After I submit the form the page reloads but shows only the header, footer and sidebar without the content. The results output doesn't work regardless that I try to add them to the same or another page.
The other bureaucracy actions (email and template) work fine.
I have the same problem and I can't find any solutions on this page. I would like to add that my DokuWiki is hosted on a “UniServer” installation and I'm running the latest version of DokuWiki and bureaucracy, but my page only shows the header other then that it's as described above. I'm hoping to bring some attention to this problem by placing this comment — Ric 2010/05/10 23:49
The same happens here, just a blank page after submit when using the “Minimalistic Guestbook” – Any suggestions? — Rainer2010-09-28
From Author : I cannot replicate this even using the latest software,firefox/opera and ie7, please can you give me more information, like does it work, but just not display? What platform version etc
From Author : This has been confirmed fixed by the bug raiser, no idea what I did, but nevertheless the bug has moved on
I already asked this on the bureaucracy page but maybe it could be implemeted here. Is there a way to use multiple drop-downboxes where the input in the first box affects which options are available in the 2nd one and so on? Thanks! - Paul
From Author - This will have to be done in the bureaucracy plugin, I don't have much to do with the front end.
When looking for the possibility of using both mail and pagemod actions from the same form, I came across a small extension to the pagemod plugin, namely the 'pagemodandmail' action handler. However, likely because both buraucracy and pagemod has come in new versions, I had to do som small adjustments to make it work. So this is the version 1.2 compliant version of the extension.
To install, add the following piece of code as a file named 'pagemodandmail.php' in dokuwikilib/plugins/bureaucracy/actions directory:
<?php // charset=utf-8 /** * Action pagemod followed by sendemail for DokuWiki plugin bureaucracy */ class syntax_plugin_bureaucracy_action_pagemodandmail extends syntax_plugin_bureaucracy_action { /** * Simply extract the relevant arguments and call the relevant actions */ function run($data, $thanks, $argv) { global $ID; global $conf; require_once(DOKU_PLUGIN . 'bureaucracy/actions/action.php'); require_once(DOKU_PLUGIN . 'bureaucracy/actions/pagemod.php'); require_once(DOKU_PLUGIN . 'bureaucracy/actions/mail.php'); $pagemodargs = array_slice($argv,0,2); $emailargs = array_slice($argv,2); $class = 'syntax_plugin_bureaucracy_action_pagemod'; $pagemodder = new $class(); $pagemodsuccess = $pagemodder->run($data, $thanks, $pagemodargs); $class = 'syntax_plugin_bureaucracy_action_mail'; $emailer = new $class(); $emailsuccess = $emailer->run($data, $thanks, $emailargs); $rmsg = ''; if (!$pagemodsuccess) {$rmsg .= "Pagemod failed";} if (!$emailsuccess) {$rmsg .= "Emailing failed";} if ($rmsg=='') {return $thanks;} else {return $rmsg.join(',',$errors);} } }
Use the following notation in the form:
action pagemodandmail <page:to:update> <tag> <email_address1> <email_address2> <email_address3> ....
Example:
<form> action pagemodandmail support:subsystem:registered_bugs buglist 1st_address@example.com 2nd_address@example.com Thanks "Thanks for your input." Fieldset "Error report" Textbox "Name" email "Email" select "Subsystem" "sub1|sub2|sub3" textarea "Description" textarea "Error message(s)" submit "Send report" </form>
The page support:subsystem:registered_bugs must be edited with the following pagemod entry
^ Name ^ Subsystem ^ Description ^ Error message(s) ^ <pagemod buglist output_before>|@@Name@@ |@@Email@@ |@@Subsystem@@ |@@Description@@ |@@Error message(s)@@ |</pagemod>
Knut S. Dale 2010/12/27
Would such syntax be possible:
<form> action pagemod _self,another:page:somewhere:else id fieldset "Ereignis eingeben" textbox "Ereignis:" /^((?!<\/code>).|\n)*$/ date "Gültig von:" date "bis:" textarea "Details:" /^((?!<\/code>).|\n)*$/ submit "Ereignis veröffentlichen" </form>
making it possible to have one form which places the info on more than one page? - Andy
edittable
plugin - see description in edittable.
The pageredirector plugin allows you to redirect users between pages and namespaces by adding a particular pattern to a page.
A simple code redirects to another page:
~~REDIRECT>namespace:page~~
You can also use this syntax since 20120612 version:
#REDIRECT namespace:page
Sometimes one may need to do simple calculations in DokuWiki table. The idea was taken from plugin:tablemath plugin, but conception changed a little bit. With the help of the plugin:tablecalc plugin you would be able to insert Excel styles formulas into the table
Download and install the plugin using the Plugin Manager using the following URL. Refer to :Plugins on how to install plugins manually.
To perform a calculation you need to insert XL-style formula into work sheet. Any expression must be started with ~~=
and finished by ~~
. You can use direct range specification for functions (like XL does) or a special range()
function. The range consists of a reference to the start cell and to the finish cell, like this:
r0c4
Please note, that row (r
) and column (c
) index starts from zero. Row and column prefixes can be swapped. The following is equal of the above:
c4r0
You can also reference to multiple cells in one range:
|r0c0:r1c1||
Furthermore you can use multiple ranges:
r0c0:r1c1,r0c3:r1c4
There is a recommendation not to use references for non-existing cells. For example, this is not correct (though it will work, returning “3”):
| 1 | | 2 | | ~~=sum(r0c0:r99c99)~~ |
Instead use constructions like this:
| 1 | | 2 | | ~~=sum(range(0,0,col(),row()-1))~~ |
The following functions are implemented:
x
= column, y
= row
Func | Description |
---|---|
cell(x,y) | Returns numeric value of (x,y) cell |
row() | Returns current row |
col() | Returns current column |
range(x1,y1,x2,y2) | Returns internal range for other functions |
sum(range) | Returns sum of the specified range |
count(range) | Returns number of elements in the specified range |
round(number;decimals) | Returns number, rounded to specified decimals |
label(string) | Binds label to the table |
average(range) | Returns average of the specified range |
min(range) | Returns minimum value within specified range |
max(range) | Returns minimum value within specified range |
check(condition;true;false) | Executes true statement, if condition is not zero |
compare(a;b;operation) | Do math compare for a and b . Returns zero when conditions for the operation are not met |
calc() | |
Though you can use colon as delimiter in functions semi-colon is preferred and recommended.
Most of the standard Javascript arithmetic operators are supported but some 9) conflict with the table markup so the following operators are available:
Operator | Description |
---|---|
+ | Addition and unary plus |
- | Subtraction and unary negative |
* | Multiplication |
/ | Division |
% | Modulus (division remainder) |
& | Logical AND |
<< | Shift left |
>> | Shift right |
| 1 | 2 | ~~=r0c0+r0c1~~ | ~~=10.2+1.5~~ |
1 | 2 | 3 | 11.7 |
| 1 | 2 | | 3 | 4 | | ~~=sum(r0c0:r1c1)~~ ||
1 | 2 |
3 | 4 |
10 |
| 1 | 2 | 3 | 4 | | 5 | 6 | 7 | 8 | | **~~=sum(r0c0:r1c1,r0c3:r1c4)~~** ||||
1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 |
26 |
|1| |2| |3| |4| |5.74| |6| |7| |8| |9| |10| |11| |~~=sum(range(col(),0,col(),row()-1))~~|
1 |
2 |
3 |
4 |
5.74 |
6 |
7 |
8 |
9 |
10 |
11 |
65.74 |
|1| |2| |3| |4| |5| |6| |7| |8| |9| |10| |~~=average(range(col(),0,col(),row()-1))~~|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
5.5 |
| ~~=label(ex6_1)~~1 | 2 | | 3 | 4 | Sum: **~~=sum(ex6_1.c0r0:c99r99)~~**
1 | 2 |
3 | 4 |
Sum: 10
| **~~=label(ex7_1)~~11** | ~~=sum(ex7_2.c0r0:c99r99)~~ | | 13 | 14 | | ~~=label(ex7_2)~~1 | 2 | | 3 | 4 | Sum: **~~=sum(ex7_1.c0r0:c1r1)~~**
11 | 10 |
13 | 14 |
1 | 2 |
3 | 4 |
Sum: 48
| **~~=min(c0r1:c0r3)~~** | **~~=max(c1r1:c1r3)~~** | | 1 | 7 | | 2 | 8 | | 3 | 9 | ~~=calc()~~
1 | 9 |
1 | 7 |
2 | 8 |
3 | 9 |
| 1 | ~~=check(cell(0,row()),#True,#False)~~ | | 0 | ~~=check(cell(0,row()),#True,#False)~~ | | x | ~~=check(cell(0,row()),#True,#False)~~ | | | ~~=check(cell(0,row()),#True,#False)~~ | | **** | ~~=check(cell(0,row()),#True,#False)~~ |
1 | True |
0 | False |
x | False |
False | |
False |
| 1 | 2 | 1=2 | ~~=check(compare(cell(0,row()),cell(1,row()),#=),#True,#False)~~ | | 3 | 3 | 3=3 | ~~=check(compare(cell(0,row()),cell(1,row()),#=),#True,#False)~~ | | 4 | 5 | 4<5 | ~~=check(compare(cell(0,row()),cell(1,row()),#<),#True,#False)~~ | | 6 | 7 | 6>7 | ~~=check(compare(cell(0,row()),cell(1,row()),#>),#True,#False)~~ | | 8 | 9 | 8>9 | ~~=check(compare(cell(0,row()),cell(1,row()),#>),#True,#False)~~ | | 10 | 10 | 10≥10 | ~~=check(compare(cell(0,row()),cell(1,row()),#>=),#True,#False)~~ | | 11 | 11 | 11≤11 | ~~=check(compare(cell(0,row()),cell(1,row()),#>=),#True,#False)~~ | | 12 | 12 | 12≠12 | ~~=check(compare(cell(0,row()),cell(1,row()),#!=),#True,#False)~~ |
1 | 2 | 1=2 | False |
3 | 3 | 3=3 | True |
4 | 5 | 4<5 | True |
6 | 7 | 6>7 | False |
8 | 9 | 8>9 | False |
10 | 10 | 10≥10 | True |
11 | 11 | 11≤11 | True |
12 | 12 | 12≠12 | False |
Operator | Equation | Result |
---|---|---|
+ | ~~= 3 + 2 ~~ | 5 |
- | ~~= 3 - 2 ~~ | 1 |
* | ~~= 3 * 2 ~~ | 6 |
/ | ~~= 6 / 2 ~~ | 3 |
% | ~~= 7 % 2 ~~ | 1 |
unary + | ~~= +2 ~~ | 2 |
unary - | ~~= -2 ~~ | -2 |
& | ~~= 3 & 2 ~~ | 2 |
<< | ~~= 2 << 7 ~~ | 256 |
>> | ~~= 8 >> 2 ~~ | 2 |
14.04.2010
07.09.2009
col()
returns wrong number if the preceeding cells in the same row use colswap, eg:
| A | B | ~~=col()~~ | | C || ~~=col()~~ |
gives:
A | B | 2 |
C | 1 |
— Michał Sacharewicz 2012/01/11
Is it possible to make math calculations (like multiplication)… So that to add the VAT to the price for example. for or sthg similiar… Vandra Ákos 08/31/2011
very nice indeed, I need to borrow your syntax a bit, so I don't need to use ~~tm: James Lin08/09/2009
Some coding advice: You're working with a blacklist to avoid script inclusion, a whitelist might be more secure. You're using the output of rand() as a HTML ID. Numbers alone are not allowed as IDs in XHTML, you should prefix them with your plugin name. Also have a look at using_ids — Andreas Gohr 2009/09/09 15:42
The plugin definitely needs max/min and conditional functions and/or :)
Fixed all of the above — Gryaznov Sergey 2010/04/14
Can you add support for comma as decimal separator? madenate 2010/06/25
I would appreciate this, too. (Nice work, though!) — Christian 2010/09/29
Also, it would be nice if the round()
function could use the exact number of specified decimal places, even if these would be zero. See the following image as a sample why it would probably look better:
— Christian 2010/09/29
There's problem when preceeding column to calculation contains markup, it goes bezerk:^ Date ^ Description ^ Hours (Decimal) ^ | 2008-08-29 | xx | 6.5 | | 2008-08-30 | xxx | 1.5 | | 2008-09-03 | xxxx | -4.00 | | 2008-09-03 | [[:config]] yea | -4.00 | ^ ^ ^ ~~=sum(range(1,0,col(),row()-1))~~ ^
Workaround is to avoid any markup in preceeding columns, i.e in this sample swap Description
and Hours
columns
— glen 2010/12/08 14:04
None of the formulas outputs results for me (on Anteater). Any known conflicts with other plug-ins?
— mubed 2012/05/30 14:28
Integrates a simple task management tool into your wiki.
~~TASK:[user]?[due date][priority]~~
[user] | person responsible for this task – either user or full name | optional; default is unassigned |
---|---|---|
[due date] | date the task should be completed in YYYY-MM-DD form; if only year or year and month are given, the last day is assumed | optional; default is without due date |
[priority] | low, medium ! , high !! or critical !!! expressed with 0 to 3 exclamation marks | optional; default is low priority |
Place ~~TASK~~
on any page to mark it as a task. The title (first heading) is considered to be the summary of the task, the contents its description.
If a task is unassigned, any registered user of the wiki can accept it. Once a task is taken, the user to whom it is assigned to can change the status of the task to one of these values:
If the task is done, other users can verify whether it's really done. If yes, the status can be set to verified.
The priority is reflected by the intensity of the orange shade of the task box.
Next to the title of the task box is an icon. It links to download an .ics file for the task. That can be imported by almost any calendar application that understands the VTODO component of the iCalendar standard.
{{tasks>[namespace]?[view]&[flags]}}
[namespace] | the namespace to look for tasks | required |
---|---|---|
[view] | one of the views, see here | optional; default is open |
[flags] | pagelist flags delimited by & , see flags | optional |
Views
all | all tasks |
---|---|
open | all task that are new, not yet done (or rejected) if assigned to me or not yet verified if assigned to someone else |
my | only my open tasks |
new | new tasks not yet assigned to anybody |
done | completed but not yet verified tasks |
due | all open tasks with a due date of today |
overdue | all open tasks with a due date in the past |
Flags
noform | Don't show the new task form |
---|
Universal plugin which combines the functionality of many other plugins. Wrap wiki text inside containers (divs or spans) and give them a class (choose from a variety of preset classes), a width and/or a language with its associated text direction.
This plugin gives you the ability to wrap wiki text inside containers (divs or spans) and give them
The plugin comes with an example page, which should explain a lot and looks like this in the default template:
Basic Syntax:
<WRAP classes #id width :language> "big" content </WRAP> or <block classes #id width :language> "big" content </block> or <div classes #id width :language> "big" content </div>
An uppercase <WRAP> (or alternatively <block> or <div>) creates a div
and should be used for “big” containers, surrounding paragraphs, lists, tables, etc.
<wrap classes #id width :language>"small" content</wrap> or <inline classes #id width :language>"small" content</inline> or <span classes #id width :language>"small" content</span>
A lowercase <wrap> (or alternatively <inline> or <span>) creates a span
and should be used for “small” containers, inside paragraphs, lists, tables, etc.
Please note, some things won't work with spans: alignments (including alignments generated by changing the text direction), multi-columns and widths if the according wrap isn't floated as well.
The following classes are currently available:
class name | description/notes |
---|---|
columns – similar to columns, side_note, styler, tip | |
column | same as left in LTR languages and same as right in RTL languages |
left | same as column , will let you float your container on the left |
right | will let the container float right |
center | will position the container in the horizontal center of the page |
col2 ..col5 | will show the text in multiple columns (2, 3, 4 or 5), only works in modern browsers (Firefox, Chrome and Safari) |
widths – |
|
half | fits two columns in a row, should be used in pairs |
third | fits three columns in a row, should be used in triplets |
quarter | fits four columns in a row, should be used in quads |
alignments – similar to divalign, columns, styler – |
|
leftalign | aligns text on the left |
rightalign | aligns text on the right |
centeralign | centers the text |
justify | justifies the text |
boxes and notes – similar to box, note, tip | |
box | creates a box around the container (uses colours from style.ini ) |
info (was information in first version) | creates a blue box with an info icon |
important | creates an orange box with an important icon |
alert (warning in previous versions) | creates a red box with an alert icon |
tip | creates a yellow box with a tip icon |
help | creates a violet box with a help icon |
todo | creates a cyan box with an todo icon |
download | creates a green box with a download icon |
round | adds rounded corners to any container with a background colour or a border (only works in modern browsers, i.e. no IE) |
danger | creates a red danger safety note |
warning | creates an orange warning safety note |
caution | creates a yellow caution safety note |
notice | creates a blue notice safety note |
safety | creates a green safety note |
marks – similar to emphasis, important_paragraf, importanttext | |
hi | marks text as highlighted |
lo | marks text as less significant |
em | marks text as especially emphasised |
miscellaneous | |
clear | similar to clearfloat, should preferably be used with divs, i.e. uppercase <WRAP> s |
tabs | if wrapped around a list of links, will show those as tabs |
hide | hides the text per CSS (the text will still appear in the source code, in non-modern browsers and is searchable) |
noprint | displays text on the screen, but not in print, similar to noprint |
onlyprint | displays text only in print, but not on the screen |
pagebreak | forces a new page in printouts (not visible on the screen), similar to pagebreak |
nopagebreak | tries to avoid a pagebreak in printouts (not visible on the screen) |
spoiler | shows white text on a white background, only to be revealed by highlighting it; similar to hide |
indent | indents the text, could be used instead of tab |
outdent | “outdents” the text, could partly be used instead of outdent |
prewrap | wraps text inside pre-formatted code blocks, similar to wpre |
All tables inside a column or box will always be 100% wide. This makes positioning and sizing tables possible and partly replaces tablewidth.
You probably need to adjust a few of the classes to your template's needs, especially hi
, lo
and em
if you have a dark or otherwise heavily coloured theme.
The classes are easily adjustable and extensible. Any wishes are welcome.
You can set any valid widths on any uppercase <WRAP> container: %, px, em, ex, pt, pc, cm, mm, in
. Just set the width before or after or with the classes, e.g.
<WRAP someclass 50% anotherclass>...
All except percentages will be reduced to have the maximum width available on smaller screens.
You can also use the width keywords half
, third
and quarter
. To work correctly they need another wrap around them. E.g.
<WRAP group> <WRAP half column>...</WRAP> <WRAP half column>...</WRAP> </WRAP>
will result in two columns next to each other, which will wrap underneath each other on smaller screens and mobile devices.
You can change the language and the direction of a container by simply adding a colon followed by the language code, like this:
<wrap :en>This text is explicitly marked as English.</wrap>
The text direction (rtl
, right to left or ltr
, left to right) will get inserted automatically and is solely dependent on the language. The list of currently supported languages is taken from: http://meta.wikimedia.org/wiki/Template:List_of_language_names_ordered_by_code
If you like to mark a text with a different text direction than the default one, you should use divs, i.e. uppercase <WRAP>
s. Otherwise the text alignment won't change as well.
You can see a demo of the plugin on wrap_example.
Option | Description | Default value |
---|---|---|
noPrefix | Which (comma separated) class names should be excluded from being prefixed with “wrap_” | tabs, group |
restrictedClasses | restrict usage of plugin to these (comma separated) classes | (empty) |
restrictionType | restriction type, specifies if classes above shall be included or excluded | 0 |
syntaxDiv | Which syntax should be used in the toolbar picker for block wraps? | WRAP (other choices: div, block) |
syntaxSpan | Which syntax should be used in the toolbar picker for inline wraps? | wrap (other choices: span, inline) |
The wrap picker in the editing toolbar adds the most common wrap syntaxes.
<WRAP clear></WRAP>
An uppercase <WRAP> (or alternatively <block> or <div>) creates a div
and should be used for “big” containers, surrounding paragraphs, lists, tables, etc.
<WRAP classes width :language> "big" content </WRAP> or <block classes width :language> "big" content </block> or <div classes width :language> "big" content </div>
A lowercase <wrap> (or alternatively <inline> or <span>) creates a span
and should be used for “small” containers, inside paragraphs, lists, tables, etc.
<wrap classes width :language>"small" content</wrap> or <inline classes width :language>"small" content</inline> or <span classes width :language>"small" content</span>
Please note, some things won't work with lowercase spans:
if the according wrap isn't floated as well.
You can have columns easily by adding the class column
and a width, e.g.
<WRAP column 30%>...content...</WRAP>
Emulated Big Headline
You can emulate a big headline with italic, bold and underlined text, e.g.
//**__Emulated Big Headline__**//
Emulated Small Headline
A smaller headline uses no underlining, e.g.
//**Emulated Small Headline**//
If you need text that is bold and italic, simply use it the other way around:
**//No Headline//**
Different Floating Options
Normally you would only need the class column
, but for more sophisticated uses (not only for columns, but for any other classes, like boxes and notes as well) you can have several kinds of “floats”:
column
is the same as left
in LTR languages and the same as right
in RTL languages
left
will let you float your wrap on the left
right
will let the wrap float right
center
will position the wrap in the horizontal center of the page
Widths
You can set any valid widths (but only on divs): %, px, em, ex, pt, pc, cm, mm, in
, but most of the time you'd only want either
type | e.g. | note |
---|---|---|
% | 30% | makes sense in a liquid layout |
px | 420px | makes sense if your layout has a fixed pixel width or if your container contains images with a certain width |
em | 20em | makes sense if you like your wrap container to grow and shrink with the font size or if your layout is em-based |
A table inside a column or box will always be 100% wide. This makes positioning and sizing tables possible.
After using any of the float classes, you might come across something like this, where the following text protrudes into the space where only the floating containers should be …
… to prevent that, you should simply add
<WRAP clear></WRAP>
after your last column.
You can use the same options with spans (as each element that floats is automatically a block level element), but it probably doesn't make too much sense. Widths on spans normally do not work (by design), but can make sense, when it is floating.
Attention: Widths can cause problems and will often look different and break in some browsers. If you're not a web developer, you might not understand any problems regarding the box model. Just try to test your columns in all major browsers and make your widths smaller than you initially think they should be.
All of those options will also work in the boxes and notes wraps (see below).
For modern browsers (Firefox, Chrome and Safari) you can use multi-columns. Just use col2
for 2 columns, col3
for 3 columns, col4
for 4 columns and col5
for 5 columns.
Note: Multi-columns don't make sense for spans.
You can use these different text alignments:
leftalign
rightalign
centeralign
justify
Center aligned text …
… and right aligned.
<WRAP centeralign> Center aligned text ... </WRAP> <WRAP rightalign> ... and right aligned. </WRAP>
You cannot add alignments to spans.
round box 570px center
box
creates a box around the container and uses the colours from the template's style.ini
as default colours (__background_alt__
and __text__
)
info
, tip
, important
, alert
, help
, download
, todo
will add a special note container with a corresponding icon
danger
, warning
, caution
, notice
, safety
use safety colours (and no icons)
round
can be added to anything with a background colour or a border and will only work in modern browsers (no Internet Explorer)
Info
<WRAP info></WRAP>
Tip
<WRAP tip></WRAP>
Important
<WRAP important></WRAP>
Alert
<WRAP alert></WRAP>
Help
<WRAP round help></WRAP>
Download
<WRAP download></WRAP>
Todo
<WRAP todo></WRAP>
Safety Notes:
Danger
<WRAP danger></WRAP>
Warning
<WRAP warning></WRAP>
Caution
<WRAP caution></WRAP>
Notice
<WRAP round notice></WRAP>
Safety
<WRAP round safety></WRAP>
You can use notes and boxes also inside text with spans like this: info, help, alert, important, tip, download, todo and round box and danger, warning, caution, notice, safety.
<wrap info>info</wrap>, <wrap help>help</wrap>, ...
You can mark text as highlighted, less significant and especially emphasised.
You can mark text as <wrap hi>highlighted</wrap>, <wrap lo>less significant</wrap> and <wrap em>especially emphasised</wrap>.
This might look ugly in some templates and should be adjusted accordingly.
This text will appear indented.
<wrap indent>This text will appear indented.</wrap>
This text will appear “outdented”.
<wrap outdent>This text will appear "outdented".</wrap>
Inside this code block the words will wrap to a new line although they are all in one line.
<WRAP prewrap 250px> <code> Inside this code block the words will wrap to a new line although they are all in one line. </code> </WRAP>
Here follows a spoiler: Darth Vader is Luke's father.
Here follows a spoiler: <wrap spoiler>Darth Vader is Luke's father.</wrap>
Just select the text in the spoiler box to be able to read its content.
The following text is hidden: John, please revise that sentence.
The following text is hidden: <wrap hide>John, please revise that sentence.</wrap>
Warning: The text will still appear in the source code, in non-modern browsers and is searchable. Do not hide any security risky secrets with it!
The following will add a pagebreak:
The following will add a pagebreak: <WRAP pagebreak></WRAP>
This has no effect on the browser screen. A pagebreak will force a new page in printouts.
The following will try to avoid a pagebreak:
much content, belonging together (like a long table)
The following will try to avoid a pagebreak: <WRAP nopagebreak>much content, belonging together (like a long table)</WRAP>
This also has no effect on the browser screen. It will try to avoid a page break in printouts.
This text appears on the screen, but not in print.
<wrap noprint>This text appears on the screen, but not in print.</wrap>
This text does not appear on the screen, but only in print.
<wrap onlyprint>This text does not appear on the screen, but only in print.</wrap>
I advice against using the following typography classes. It's better to create semantic classes that reflect their meaning instead.
sansserif
, serif
, monospace
bigger
, muchbigger
, smaller
fgred
, fggreen
, fgblue
, fgcyan
, fgviolet
, fgyellow
, fggrey
, fgwhite
, fgblack
bgred
, bggreen
, bgblue
, bgcyan
, bgviolet
, bgyellow
, bggrey
, bgwhite
, bgblack
You can combine and nest all classes and types of boxes, e.g.
Outer green box floats right
Inner nested box floats left and is partly emphasized and highlighted with nested bigger text inside.
Text inside outer right box, but beneath inner left box.
Round tip box underneath, after a clear
.
<WRAP box bggreen fgblack 350px right :en> //**__Outer green box floats right__**// <WRAP 165px left> Inner nested box floats left and is partly <wrap em hi>__em__phasized and __hi__ghlighted with nested <wrap bigger>__bigger__ text</wrap> inside</wrap>. </WRAP> Text inside outer right box, but beneath inner left box. <WRAP clear></WRAP> <WRAP round tip> Round tip box underneath, after a ''clear''. </WRAP> </WRAP>
You can change the language and the reading direction of a wrap container by simply adding a colon followed by the language code, like this:
<WRAP :he> זה עברית. ((<wrap :en>This means "This is Hebrew.", at least according to [[http://translate.google.com/|Google Translate]].</wrap>)) </WRAP>
זה עברית. 10)
The text direction (rtl
, right to left or ltr
, left to right) will get inserted automatically and is solely dependent on the language. The list of currently supported languages is taken from: http://meta.wikimedia.org/wiki/Template:List_of_language_names_ordered_by_code
(If you specify a language not listed there, it simply won't do anything.)
/lib/tpl/default/main.php
, there are two divs that contain some buttons: and
''. Just insert the HTML code inside one of the two divs (left or right) ))<form class="button" method="get" action="<?php wl($ID)?>">
<div class="no">
<input type="submit" value="Add/Remove selection" class="button" />
<input type="hidden" name="do" value="addtobook" />
<input type="hidden" name="id" value="<?php echo $ID?>" />
</div>
</form>
Monobook
When using the template “monobook for DokuWiki”, to have an Add/Remove link, in /user/tabs.php, use this code//pdfbook plugin: add/remove selection
if (file_exists(DOKU_PLUGIN."bookcreator/action.php") &&
!plugin_isdisabled("bookcreator")){
$_monobook_tabs["tab-bookcreator"]["text"] = "Add/Remove to selection";
$_monobook_tabs["tab-bookcreator"]["href"] = wl(getID(), array("do" => "addtobook"), false, "&");
}
Changing the order of wiki pages
To change the order of wiki pages in your book, simply move the pages in the list. To do so, hover over the page title to move, click and drag it to the new location. Release the mouse button to finish moving the page to its new location.
Saving books
Format of stored book pages: when you save a book, it is stored in the format shown below.====== MyBookName ======
* [[:first_pages]]
* [[:second_page]]
* .....
* [[:last_page]]
You can also manually create a book from scratch by using the same format. To create a book from scratch, start a new page such as wiki:ebook:mybookname (default). The namespace can be changed at admin side configuration.
2)
If it is not, metadata of the btable with the same id gets mixed up, i.e. answers to choices in a previous btable appear in the new when the choices are the same.
3)
relative to your dokuwiki root
4)
This feature is based on a custom branch of the PrettyPhoto library
9)
The conflicting operators are: ^ | ~
10)
This means “This is Hebrew.”, at least according to Google Translate.
Copyright © Alan Shea, 2011-2025