Difference between revisions of "Template:DPL Page Name S/N Maker"

From FollowTheScore
Jump to: navigation, search
Line 1: Line 1:
 +
The next serial number is  {{#if:{{{namespace|}}}|{{{namespace|}}}:}}{{{prefix|}}}{{#pad:
 +
      {{#expr:
 +
        {{#replace:
 +
            {{#replace:
 +
              {{#dpl:titleregexp=^{{{prefix|}}}[0-9]{{{{pad|5}}}}$<!---
 +
                -->|namespace={{{namespace|}}}<!---
 +
                -->|order=descending<!---
 +
                -->|noresultsheader={{#pad:0|{{{pad|5}}}|0}}<!---
 +
                -->|count=1
 +
              }}
 +
              |/^([^{{!}}]+\{{!}}){1}([^\]]+).*/
 +
              |\2
 +
            }}
 +
          |{{{prefix|ECP-}}}
 +
          |
 +
        }}                      <!--  {{{prefix}}}-00004 => 00004  -->
 +
      +1}}                    <!--            00004+1 => 5      -->
 +
    |{{{pad|5}}}|0}}          <!--                  5 => 00005  -->
 +
 
{{#inputbox:
 
{{#inputbox:
 
   |type=create
 
   |type=create
Line 4: Line 23:
 
   |width={{{width|25}}}
 
   |width={{{width|25}}}
 
   |editintro={{{editintro|}}}
 
   |editintro={{{editintro|}}}
  |titleprefix={{#if:{{{namespace|}}}|{{{namespace|}}}:}}
 
 
   |preload={{{preload|}}}
 
   |preload={{{preload|}}}
 
   |break=no
 
   |break=no
   |default={{{prefix|ECP-}}}{{#pad:
+
   |default={{#if:{{{namespace|}}}|{{{namespace|}}}:}}{{{prefix|}}}{{#pad:
 
       {{#expr:
 
       {{#expr:
 
         {{#replace:
 
         {{#replace:
 
             {{#replace:
 
             {{#replace:
               {{#dpl:titleregexp=^{{{prefix|ECP-}}}[0-9]{{{{pad|5}}}}$<!---
+
               {{#dpl:titleregexp=^{{{prefix|}}}[0-9]{{{{pad|5}}}}$<!---
 
                 -->|namespace={{{namespace|}}}<!---
 
                 -->|namespace={{{namespace|}}}<!---
 
                 -->|order=descending<!---
 
                 -->|order=descending<!---
Line 25: Line 43:
 
       +1}}                    <!--            00004+1 => 5      -->
 
       +1}}                    <!--            00004+1 => 5      -->
 
     |{{{pad|5}}}|0}}          <!--                  5 => 00005  -->
 
     |{{{pad|5}}}|0}}          <!--                  5 => 00005  -->
}}
+
}}<noinclude>
 +
{|per|
 +
 
 +
 
 +
== 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>
 +
</noinclude>
 +
 
 +
== Demo ==
 +
*See [http://semeb.com/dpldemo/index.php?title=Template:DPL_Page_Name_S/N_Maker here]

Revision as of 04:08, 31 March 2008

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}}           

}}

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
}}


Demo