plugin:pagemod
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:pagemod [2015-08-06 12:38] – 89.202.231.254 | plugin:pagemod [2024-01-20 07:55] (current) – Aleksandr | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | ^ Date ^ Supplier ^ Our Cost (Single) ^ Client Cost (Single) ^ Quantitiy Ordered ^ Client Cost (Full), ex VAT ^ | + | ---- plugin ---- |
- | | 01/02/2009 | B&C | 54.00 | 56.00 | 234.00 | 213.00 | | + | description: |
- | | 03/03/2009 | IT Vision | 34 | 989 | 3 | 2390 | | + | author |
- | | 01/02/2009 | Computer Corporation | 3453 | 3453 | 345 | 34535 | | + | email : info@baseline-remove-this-it.co.za |
- | | a | Computer Corporation | a | marco | a | 2 | | + | type : syntax |
- | <pagemod add_sale output_before> | + | lastupdate : 2014-11-10 |
- | </ | + | compatible : 2016-06-26, Detritus, Hrun, Ponder Stibbons, Greebo, Hogfather, Igor |
+ | depends | ||
+ | conflicts | ||
+ | similar | ||
+ | tags : form, create, update, editing | ||
+ | downloadurl: | ||
+ | bugtracker : https:// | ||
+ | sourcerepo : https:// | ||
+ | screenshot_img : | ||
+ | ---- | ||
+ | |||
+ | ===== Download and Installation ===== | ||
+ | |||
+ | Search and install the plugin using the [[plugin: | ||
+ | |||
+ | |||
+ | ===== Overview ===== | ||
+ | |||
+ | 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. | ||
+ | |||
+ | It works loosely in the following way: | ||
+ | - A form exists on a page (created by the [[plugin: | ||
+ | * this can be the page to be modified or it can be another page. | ||
+ | * this form contains the action field '' | ||
+ | - A results placeholder sits on a target page | ||
+ | * this placeholder is enclosed by the ''< | ||
+ | - The form is filled in and submitted. Subsequently the pagemod action extends the target page by including a copy of the placeholder wherein the variables are replaced with the form values. | ||
+ | |||
+ | So here are the features: | ||
+ | |||
+ | * A page with a form can update itself or another page. | ||
+ | * Each ''< | ||
+ | * The form can update multiple sections of a page. | ||
+ | * All the sections need to have the same '' | ||
+ | * A person can update a page that they **don' | ||
+ | * Only read access is required to modify a page via the form. (This is not a bug, its a feature.) | ||
+ | * It means you can prevent people from modifying a page unless they do it via a form. | ||
+ | * If you want people to only have access to read the resultant page, but not change it, protect the **form** page. | ||
+ | * No read access to result page for a user, prevents modifying it via form. | ||
+ | * Updating more pages at once is possible by adding an action field for each page | ||
+ | |||
+ | That's it. | ||
+ | |||
+ | |||
+ | ===== Usage ===== | ||
+ | |||
+ | |||
+ | ==== Form Syntax ==== | ||
+ | |||
+ | Defining a form is done via the [[plugin: | ||
+ | < | ||
< | < | ||
- | action pagemod | + | action pagemod |
- | fieldset "Add your bits to the table" | + | < |
- | textbox | + | |
- | select | + | |
- | textbox | + | |
- | textbox | + | |
- | textbox | + | |
- | textbox | + | |
submit | submit | ||
</ | </ | ||
+ | </ | ||
- | ===== Reverse Order List ===== | + | To make bureaucracy use the pagemod action, you need to add **action pagemod** with the following parameters: |
- | <pagemod add_sale output_after> | + | * '' |
- | * Date is @@Date@@, Support is @@Supplier@@, | + | * absolute pageids |
- | * Date is a, Support is Computer Corporation, | + | * Relative pageids, which are solved with respect to current page (e.g. '' |
- | | + | * **_self** to denote the same page as the form |
- | | + | * '' |
- | * Date is 01/02/2009, Support | + | |
+ | |||
+ | ==== Template Syntax ==== | ||
- | ===== Nothing should be seen below here ever ===== | + | Defining a pagemod template is done within a page with the following code: |
- | < | + | < |
+ | < | ||
+ | The wiki text will be parsed | ||
+ | or ##Field2 from form## | ||
+ | |||
+ | The contents of this section are invisible and will not show up on this page. | ||
</ | </ | ||
+ | Some other wiki text around, that is visible again. | ||
+ | </ | ||
+ | |||
+ | Or an real example for adding rows to a table: | ||
+ | |||
+ | < | ||
+ | Some more text, and a table with as last row the pagemod placeholder. | ||
+ | |||
+ | ^ Table header 1 ^ Table header 2 ^ | ||
+ | <pagemod table_adder output_before> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | **Note:** If the resulting table is later edited with [[plugin: | ||
+ | |||
+ | |||
+ | The pagemod enclosure starts with: | ||
+ | |||
+ | <pagemod < | ||
+ | |||
+ | where the following is true: | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | The pagemod enclosure ends with the following: | ||
+ | |||
+ | </ | ||
+ | |||
+ | and the contents are not shown when the wiki page is viewed. Converting of the contents of the pagemod enclosure is done with the [[plugin: | ||
+ | |||
+ | |||
+ | ===Meta variables=== | ||
+ | |||
+ | The meta variable are some extra variables for the pagemod plugin. The meta variables values are generated by the plugin at runtime. They are the following: | ||
+ | |||
+ | * **@@meta.date@@** : The current date in dd/mm/yyyy | ||
+ | * **@@meta.datetime@@** : The current datetime according to ISO 8601 | ||
+ | * **@@meta.date.format.// | ||
+ | * **@@meta.user.id@@** : The user who submitted the form's username | ||
+ | * **@@meta.user.mail@@** : The users email address (if we know it) | ||
+ | * **@@meta.user.name@@** : The users full name (if we know it) | ||
+ | * **@@meta.page.id@@** : The full id of the page | ||
+ | * **@@meta.page.name@@** : The name of the page | ||
+ | * **@@meta.page.namespace@@** : The namespace of the page | ||
+ | |||
+ | New meta information tag requests should be sent to me for implementation. | ||
+ | |||
+ | |||
+ | ==== Incrementing number (by 1) ==== | ||
+ | |||
+ | The [[plugin: | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * Both of them has auto incrementing counter on each succesfull submit. | ||
+ | |||
+ | < | ||
+ | number " | ||
+ | number " | ||
+ | number " | ||
+ | hiddenautoinc "Four (notice: conflicts with Two)" | ||
+ | number " | ||
+ | number " | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Upload ==== | ||
+ | |||
+ | For the moment, // | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | **On the same page example:** | ||
+ | |||
+ | < | ||
+ | < | ||
+ | action pagemod _self add_sale | ||
+ | |||
+ | fieldset "Add your bits to the table" ! | ||
+ | number "Nr. de ordine internă automat" | ||
+ | date "Data începerii melodiei" | ||
+ | select | ||
+ | textbox | ||
+ | textbox | ||
+ | |||
+ | |||
+ | fieldset | ||
+ | textbox | ||
+ | select | ||
+ | |||
+ | fieldset | ||
+ | number | ||
+ | textbox | ||
+ | |||
+ | fieldset | ||
+ | select | ||
+ | number | ||
+ | |||
+ | fieldset | ||
+ | yesno " | ||
+ | |||
+ | fieldset | ||
+ | textbox | ||
+ | number | ||
+ | |||
+ | |||
+ | fieldset | ||
+ | yesno " | ||
+ | |||
+ | fieldset | ||
+ | file " | ||
+ | |||
+ | hidden " | ||
+ | hidden " | ||
+ | |||
+ | hidden " | ||
+ | hidden " | ||
+ | |||
+ | fieldset | ||
+ | submit " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | ^ Nr. ^ Data Automata | ||
+ | | a12 | 06 Nov 2018 | 2018-11-06 | ||
+ | <pagemod add_sale> | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | --- [[user> | ||
+ | |||
+ | |||
+ | ===== FAQ ===== | ||
+ | |||
+ | ===== Development ===== | ||
+ | |||
+ | In November 2014 the pagemod plugin is updated to use a helper for the pagemod action. The Bureaucracy Plugin is updated in November 2014 as well, it will load this helper automatically if used in a form. The new version of Bureaucracy supports only the new version of Pagemod. | ||
+ | |||
+ | Remark: the file '' | ||
+ | |||
+ | ==== Previous versions ==== | ||
+ | |||
+ | * http:// | ||
+ | * http:// | ||
+ | * http:// | ||
+ | |||
+ | IMPORTANT NOTE: When you have installed these previous versions, you WILL need to UPDATE it once. This is because it installs some stuff into the bureaucracy directory, but this action doesn' | ||
+ | To update the plugin, click " | ||
+ | |||
+ | |||
+ | === Manual installation of previous version === | ||
+ | |||
+ | In '' | ||
+ | |||
+ | < | ||
+ | pagemod/ | ||
+ | pagemod/ | ||
+ | bureaucracy/ | ||
+ | bureaucracy/ | ||
+ | bureaucracy/ | ||
+ | </ | ||
+ | |||
+ | (note: since November 2014 no files are copied to bureaucracy plugin folder anymore) | ||
+ | |||
+ | ===== Bugs and feature requests===== | ||
+ | |||
+ | The pagemod plugin is strongly intertwined with the bureaucracy plugin. For general questions and issues see also the [[bureaucracy|Bureaucracy plugin]] wiki page and the [[https:// | ||
+ | |||
+ | Please report issues and requests for Pagemod Plugin at https:// | ||
+ | |||
+ | QUESTION: Can pagemod be triggered conditionally? | ||
+ | |||
+ | |||
+ | ==== Problem and solution ==== | ||
+ | |||
+ | The standard pagemod helper code does not do any substitution of page names according to bureaucracy variables. | ||
+ | textbox Hnode | ||
+ | action | ||
+ | the problem being that '' | ||
+ | |||
+ | diff: | ||
+ | 39,40d38 | ||
+ | < // | ||
+ | < | ||
+ | |||
+ | |||
+ | ===== Example usecases ===== | ||
+ | |||
+ | An bundle of example pages is available: | ||
+ | * http:// | ||
+ | |||
+ | Content: | ||
+ | * Some forms which modify the page of the form, or just another page. | ||
+ | * Extending an existing table | ||
+ | * Adding additional list items | ||
+ | |||
+ | |||
+ | ==== Minimalistic Guestbook ==== | ||
+ | |||
+ | 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:// | ||
+ | |||
+ | < | ||
+ | ======Guestbook===== | ||
+ | |||
+ | ===== New Comment ===== | ||
+ | |||
+ | < | ||
+ | action pagemod _self add_comment | ||
+ | fieldset "Write new comment" | ||
+ | textbox | ||
+ | email "Email (optional)" | ||
+ | textarea " | ||
+ | submit | ||
+ | </ | ||
+ | |||
+ | ===== Comments ===== | ||
+ | |||
+ | <pagemod add_comment output_after> | ||
+ | // | ||
+ | ^< | ||
+ | |< | ||
+ | </ | ||
+ | </ | ||
+ | --- //M. 2010/ |
plugin/pagemod.1438857498.txt.gz · Last modified: 2015-08-06 12:38 by 89.202.231.254