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

From FollowTheScore
Jump to: navigation, search
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
The next serial number is {{#if:{{{namespace|}}}|{{{namespace|}}}:}}{{{prefix|}}}{{#pad:
+
The next serial number is '''
      {{#expr:
+
{{#if:{{{namespace|}}}|{{{namespace|}}}:}}{{{prefix|}}}<!--
         {{#replace:
+
-->{{#pad:<!----------------- (X+1)                        =>  0000(X+1)
             {{#replace:
+
      -->{{#expr:<!-----------0000X+1                      =>  (X+1)
              {{#dpl:titleregexp=^{{{prefix|}}}[0-9]{{{{pad|5}}}}$<!---
+
         -->{{#replace:<!------"Namespace:prefix0000X"      =>  "0000X"
                -->|namespace={{{namespace|}}}<!---
+
             -->{{#replace:<!---"*[[Namespace:prefix0000X]]"  =>  "Namespace:prefix0000X"
                -->|order=descending<!---
+
                -->{{#dpl: <!--return pages named "*[[Namespace:prefix0000X]]"
                -->|noresultsheader={{#pad:0|{{{pad|5}}}|0}}<!---
+
                  -->titleregexp=^{{{prefix|}}}[0-9]{{{{pad|5}}}}$<!---  
                -->|count=1
+
                  -->|namespace={{{namespace|}}}<!---
 +
                  -->|order=descending<!---
 +
                  -->|noresultsheader={{#pad:0|{{{pad|5}}}|0}}<!---
 +
                  -->|count=1
 +
                }}
 +
              |/^([^{{!}}]+\{{!}}){1}([^\]]+).*/ 
 +
              |\2
 
               }}
 
               }}
              |/^([^{{!}}]+\{{!}}){1}([^\]]+).*/
+
            |{{#if:{{{namespace|}}}|{{{namespace|}}}:}}{{{prefix|}}}
              |\2
+
            |
            }}
+
            }}
          |{{{prefix|ECP-}}}
+
          +1
          |
+
          }}                     
        }}                     <!--  {{{prefix}}}-00004 => 00004  -->
+
    |{{{pad|5}}}
      +1}}                    <!--            00004+1 => 5      -->
+
    |0
    |{{{pad|5}}}|0}}           <!--                  5 => 00005  -->
+
    }}'''
  
 
{{#inputbox:
 
{{#inputbox:
Line 25: Line 31:
 
   |preload={{{preload|}}}
 
   |preload={{{preload|}}}
 
   |break=no
 
   |break=no
   |default={{#if:{{{namespace|}}}|{{{namespace|}}}:}}{{{prefix|}}}{{#pad:
+
   |default={{#if:{{{namespace|}}}|{{{namespace|}}}:}}{{{prefix|}}}<!--
      {{#expr:
+
-->{{#pad:<!----------------- (X+1)                        =>  0000(X+1)
         {{#replace:
+
      -->{{#expr:<!-----------0000X+1                      =>  (X+1)
             {{#replace:
+
         -->{{#replace:<!------"Namespace:prefix0000X"      =>  "0000X"
              {{#dpl:titleregexp=^{{{prefix|}}}[0-9]{{{{pad|5}}}}$<!---
+
             -->{{#replace:<!---"*[[Namespace:prefix0000X]]"  =>  "Namespace:prefix0000X"
                -->|namespace={{{namespace|}}}<!---
+
                -->{{#dpl: <!--return pages named "*[[Namespace:prefix0000X]]"
                -->|order=descending<!---
+
                  -->titleregexp=^{{{prefix|}}}[0-9]{{{{pad|5}}}}$<!---  
                -->|noresultsheader={{#pad:0|{{{pad|5}}}|0}}<!---
+
                  -->|namespace={{{namespace|}}}<!---
                -->|count=1
+
                  -->|order=descending<!---
 +
                  -->|noresultsheader={{#pad:0|{{{pad|5}}}|0}}<!---
 +
                  -->|count=1
 +
                }}
 +
              |/^([^{{!}}]+\{{!}}){1}([^\]]+).*/ 
 +
              |\2
 
               }}
 
               }}
              |/^([^{{!}}]+\{{!}}){1}([^\]]+).*/
+
            |{{#if:{{{namespace|}}}|{{{namespace|}}}:}}{{{prefix|}}}
              |\2
+
            |
            }}
+
            }}
          |{{{prefix|ECP-}}}
+
          +1
          |
+
          }}                     
        }}                     <!--  {{{prefix}}}-00004 => 00004  -->
+
    |{{{pad|5}}}
      +1}}                    <!--            00004+1 => 5      -->
+
    |0
    |{{{pad|5}}}|0}}           <!--                  5 => 00005  -->
+
    }}
 
}}<noinclude>
 
}}<noinclude>
{|per|
 
 
  
 
== Parameters ==
 
== Parameters ==
Line 59: Line 68:
 
*'''editintro''': Specifies a page title.  The given page will be included prior to the submission form in the Edit screen.
 
*'''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.
 
*'''break''': If set to "yes", this inserts a line break between the text field and button.
 
  
 
== Example ==
 
== Example ==
Line 70: Line 78:
 
  |pad=5
 
  |pad=5
 
}}</nowiki></pre>
 
}}</nowiki></pre>
</noinclude>
+
 
 +
==Install==
 +
*See [http://www.mediawiki.org/wiki/Extension:DPL_Page_Name_S/N_Maker#Install this page].
  
 
== Demo ==
 
== Demo ==
*See [http://semeb.com/dpldemo/index.php?title=Template:DPL_Page_Name_S/N_Maker here]
+
*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
   }}

}}

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

Demo