Difference between revisions of "Template:DPL Page Name S/N Maker"
From FollowTheScore
Roc michael (talk | contribs) |
Roc michael (talk | contribs) |
||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | The next serial number is ''' | ||
+ | {{#if:{{{namespace|}}}|{{{namespace|}}}:}}{{{prefix|}}}<!-- | ||
+ | -->{{#pad:<!----------------- (X+1) => 0000(X+1) | ||
+ | -->{{#expr:<!-----------0000X+1 => (X+1) | ||
+ | -->{{#replace:<!------"Namespace:prefix0000X" => "0000X" | ||
+ | -->{{#replace:<!---"*[[Namespace:prefix0000X]]" => "Namespace:prefix0000X" | ||
+ | -->{{#dpl: <!--return pages named "*[[Namespace:prefix0000X]]" | ||
+ | -->titleregexp=^{{{prefix|}}}[0-9]{{{{pad|5}}}}$<!--- | ||
+ | -->|namespace={{{namespace|}}}<!--- | ||
+ | -->|order=descending<!--- | ||
+ | -->|noresultsheader={{#pad:0|{{{pad|5}}}|0}}<!--- | ||
+ | -->|count=1 | ||
+ | }} | ||
+ | |/^([^{{!}}]+\{{!}}){1}([^\]]+).*/ | ||
+ | |\2 | ||
+ | }} | ||
+ | |{{#if:{{{namespace|}}}|{{{namespace|}}}:}}{{{prefix|}}} | ||
+ | | | ||
+ | }} | ||
+ | +1 | ||
+ | }} | ||
+ | |{{{pad|5}}} | ||
+ | |0 | ||
+ | }}''' | ||
+ | |||
{{#inputbox: | {{#inputbox: | ||
|type=create | |type=create | ||
Line 4: | Line 29: | ||
|width={{{width|25}}} | |width={{{width|25}}} | ||
|editintro={{{editintro|}}} | |editintro={{{editintro|}}} | ||
− | |||
|preload={{{preload|}}} | |preload={{{preload|}}} | ||
|break=no | |break=no | ||
− | |default={{{prefix| | + | |default={{#if:{{{namespace|}}}|{{{namespace|}}}:}}{{{prefix|}}}<!-- |
− | + | -->{{#pad:<!----------------- (X+1) => 0000(X+1) | |
− | {{#replace: | + | -->{{#expr:<!-----------0000X+1 => (X+1) |
− | {{#replace: | + | -->{{#replace:<!------"Namespace:prefix0000X" => "0000X" |
− | + | -->{{#replace:<!---"*[[Namespace:prefix0000X]]" => "Namespace:prefix0000X" | |
− | + | -->{{#dpl: <!--return pages named "*[[Namespace:prefix0000X]]" | |
− | + | -->titleregexp=^{{{prefix|}}}[0-9]{{{{pad|5}}}}$<!--- | |
− | + | -->|namespace={{{namespace|}}}<!--- | |
− | + | -->|order=descending<!--- | |
+ | -->|noresultsheader={{#pad:0|{{{pad|5}}}|0}}<!--- | ||
+ | -->|count=1 | ||
+ | }} | ||
+ | |/^([^{{!}}]+\{{!}}){1}([^\]]+).*/ | ||
+ | |\2 | ||
}} | }} | ||
− | + | |{{#if:{{{namespace|}}}|{{{namespace|}}}:}}{{{prefix|}}} | |
− | + | | | |
− | + | }} | |
− | + | +1 | |
− | + | }} | |
− | + | |{{{pad|5}}} | |
− | + | |0 | |
− | + | }} | |
− | }} | + | }}<noinclude> |
+ | |||
+ | == Parameters == | ||
+ | All parameters to template are optional. | ||
+ | |||
+ | *'''namespace''': Specifies a Namespace, which the new page will belong to. | ||
+ | *'''prefix''': Specifies a title fragment, which will prefix the submitted title. | ||
+ | *'''pad''': The pad parameters returns the given string extended to a given width. The default value is "5". | ||
+ | *'''width''': Sets the width of the input box. | ||
+ | *'''preload''': Specifies a page title. The contents of the given page will be preloaded into the submission form. | ||
+ | *'''buttonlabel''': Sets the text of the Create button. | ||
+ | *'''default''': Sets the default text of the input box. | ||
+ | *'''editintro''': Specifies a page title. The given page will be included prior to the submission form in the Edit screen. | ||
+ | *'''break''': If set to "yes", this inserts a line break between the text field and button. | ||
+ | |||
+ | == Example == | ||
+ | <pre><nowiki>{{DPL Page Name S/N Maker | ||
+ | |width=30 | ||
+ | |editintro= | ||
+ | |namespace=Help | ||
+ | |editintro=New Issue (Intro) | ||
+ | |preload=ECP (Form) | ||
+ | |pad=5 | ||
+ | }}</nowiki></pre> | ||
+ | |||
+ | ==Install== | ||
+ | *See [http://www.mediawiki.org/wiki/Extension:DPL_Page_Name_S/N_Maker#Install this page]. | ||
+ | |||
+ | == Demo == | ||
+ | *See the [http://semeb.com/dpldemo/index.php?title=ECP_List page] and the [http://semeb.com/dpldemo/index.php?title=Template:DPL_Page_Name_S/N_Maker template]. | ||
+ | </noinclude> |
Latest revision as of 13:07, 22 March 2009
The next serial number is {{#pad:Expression error: Unrecognized punctuation character "{".
|5 |0 }}
{{#inputbox:
|type=create |buttonlabel=creat |width=25 |editintro= |preload= |break=no |default={{#pad:Expression error: Unrecognized punctuation character "{". |5 |0 }}
}}
Contents
Parameters
All parameters to template are optional.
- namespace: Specifies a Namespace, which the new page will belong to.
- prefix: Specifies a title fragment, which will prefix the submitted title.
- pad: The pad parameters returns the given string extended to a given width. The default value is "5".
- width: Sets the width of the input box.
- preload: Specifies a page title. The contents of the given page will be preloaded into the submission form.
- buttonlabel: Sets the text of the Create button.
- default: Sets the default text of the input box.
- editintro: Specifies a page title. The given page will be included prior to the submission form in the Edit screen.
- break: If set to "yes", this inserts a line break between the text field and button.
Example
{{DPL Page Name S/N Maker |width=30 |editintro= |namespace=Help |editintro=New Issue (Intro) |preload=ECP (Form) |pad=5 }}
Install
- See this page.