start
This is a test page to use different ways to create "automatically" - "by click only" a page with specified tags and parent ( with or without stabndard text by live _template
Why this is neded ? - the possibility to create only (vers short) pages with hidden tags, parent and "creator" gives a lot of ListPages possibilities for the "quiz"
Sorry, but this does not work!
Module "NewPage" needs a title (or page name) to work ( would be the easiest way - it needs only one character to cerate an autonumbered page without data…)
All other snippets does not work without going to the new created page …
Module NewPage:
attribute | required | allowed values | default | description |
---|---|---|---|---|
category | no | name of a page category | none | forces the given page category by prepending the page name by the categoryname: Note: Cannot use _default category for this. |
template | no | name of a template page | none | a page (or comma-separated list of pages) to be used as a template for the new page |
size | no | any positive integer | 30 | size of the displayed input field |
button | no | any string | "create page" | text displayed within the create page button |
format | no | any valid regular expression | none | forces the input value to match the required format |
tags | no | space-separated list of tags | none | automatically adds given tags to created pages |
parent | no | name of a page or category:page | none | automatically adds parent page to created pages |
Attributes for AutoSave function
attribute | required | allowed values | default | description |
---|---|---|---|---|
mode | no | edit, save-and-refresh, save-and-go | edit | "edit" takes you to an editor. "save-and-refresh" saves the page and refreshes the current page. "save-and-go" saves the page and goes to it (without editor) unless goTo attribute is passed |
goTo | no | valid page name | none | specifies which page to go to after automatically saving a page |
Any page that would be used as a template (passed via the template attribute) must belong to the template category, i.e. its name should contain the template: prefix, e.g. template:pagename. And must already exist.
If you choose several templates (names separated by a comma) an additional field will be displayed asking to choose a template for the page that a user wishes to create.
If you want new pages to fit match a given pattern, you can use the format attribute. To learn more about regular expressions you can see the Pattern Syntax description at the PHP main page.
Anyway, you could do:
format="/^[0-9]{5}$/" — page names would consist of exactly 5 numbers
format="/^[\d]{4}[- \/.](0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])$/" — a simple expression to match a valid date (not 100% accurate, assumes all months have 31 days)
etc.
[[module NewPage size="15" button="new testa1: page" category="testa1" tags="testa1 _a1" parent="testq1:_start" mode="save-and-refresh" ]]
This command button NEEDS a Page name(=Title!) - PLease - key in something!
Edit version:
[[module NewPage size="15" button="new testa1: page" category="testa1" tags="testa1 _a1" parent="testq1:_start" mode="edit" ]]
This command button NEEDS a Page name(=Title!) - PLease - key in something!
Snippet NewPage Button:
The NewPage Button extends upon the NewPage module — therefore, it has identical attributes to the built-in NewPage Module:
attribute | required | allowed values | default | description |
---|---|---|---|---|
name | yes if new page uses a dataform, no if it doesn't | any string | none | adds a default page name. If the category is autonumbered the pagename will be changed to the next number when the dataform is saved |
category | no | name of a page category | none | forces the given page category by prepending the page name by the categoryname: |
size | no | em, % or px | 200px | width of the displayed button |
tags | no | space-separated list of tags | none | automatically adds given tags to created pages |
parent | no | name of a page or category:page | none | automatically adds parent page to created pages |
button | no | any string | Create Page | text which appears on the button |
Extended Attributes | ||||
mode | no | manual | none | allows you to nest the NewPage Button within other modules (read more) |
window | no | new, false | false | allows you to open the page in a new window |
text | no | any string | Create Page | text which appears on the button (overrides button variable) |
site | no | full site name (i.e. http://www.wikidot.com/) | current site | creates new pages to the given website |
edit | no | true, false | true | if false, will jump to the page without force editing it |
title | no | any string or false | page name | sets the page title. If “false”, the /title/ code will be removed from the URL |
url_end | no | any string | none | appends the string you specify to the end of the URL (for advanced users) |
Note: to use the / character in the new page's title, you must type %252F (escaped version of an escaped /).
_ (I inserted a space before the include!)
[[include :snippets:newpage-button
|category=testa1
|tags=testa1
|parent=testq1:_start
|text=Click!
|edit=false
|name=testa1
|title=newpagebutton
|mode=save-and-refresh
]]
Click! |
Snippet Extended NewPage Module
The Extended NewPage Module extends upon the NewPage module — therefore, it has identical attributes to the built-in NewPage Module:
attribute | required | allowed values | default | description |
---|---|---|---|---|
category | no | name of a page category | none | forces the given page category by prepending the page name by the categoryname: |
size | no | em, % or px | 200px | size of the displayed input field |
format | no | any valid regular expression | none | forces the input value to match the required format |
tags | no | space-separated list of tags | none | automatically adds given tags to created pages |
parent | no | name of a page or category:page | none | automatically adds parent page to created pages |
Extended Attributes | ||||
mode | no | manual | none | allows you to nest the Extended NewPage Module within other modules (read more) |
window | no | new, false | false | if new, will jump to new page in a new window |
text | no | any string without "double quotes" | none | pre-fills textbox with custom text |
site | no | full site name (i.e. http://www.wikidot.com/) | current site | creates new pages to the given website |
name | no | any string, # optional | page title (as specified by the user) | sets the syntax of the UNIX page name |
edit | no | true, false | true | if false, will jump to the page without force editing it |
title | no | any string or false # optional | page title (as specified by the user) | sets the syntax of the page title. If “false”, the /title/ will be removed from the URL |
url_end | no | any string | none | appends the string you specify to the end of the URL (for advanced users) |
style | no | any styling attribute | none | changes the style of the iframe (the NewPage textbox) |
prepend | no | anything you want before the include code | [[module ListPages range="."]] | for advanced users |
append | no | anything you want after the include code | [[/module]] | for advanced users |
The optional # character is replaced with the text that the user types in.
For example, if your code contained |title=You are # and the user typed in “silly”, then the created page would have the title: You are silly.
Note: to use the # character without it being replaced by the user's input, you must type %2523 (escaped version of an escaped #).
_ I inserted a spqace before the include!
[[include :snippets:newpage
|category=testa1
|tags=testa1
|parent=testq1:_start
|text=Click!
|window=false
|edit=false
|name=testa1
|title=newpagebutton
]]