Help:Inputbox: Difference between revisions

Content deleted Content added
Achitnis (talk | contribs)
No edit summary
Leon2323 (talk | contribs)
transwiki from meta
Line 5:
 
Inputboxes are constructed like this:
{| border="0" cellspacing="5" cellpadding="5" frames="border" rules="all" bgcolor="#ffffff"
 
|-
<pre>
|<pre>
<inputbox>
type=box type
Line 13 ⟶ 14:
</inputbox>
</pre>
|}
 
The ''type'' parameter is mandatory. All other parameters are optional.
Line 46 ⟶ 48:
| colspan="2" | Add one or more sections to an existing page, or create a page, with an edit summary that is automatically the same as the (first) new section header. The button label can be specified, see below; default [[MediaWiki:Postcomment]] also used in the sidebar of the "Standard" skin. The text field specifies which page is to be edited.
|}
 
{{-}}
 
== Parameters ==
 
{| border="1" cellspacing="5" cellpadding="5" frames="border" rules="all" bgcolor="#ffffff"
!Parameter<br />''Scope''
!Description
!Example
|---
||'''bgcolor='''<br />''All types''<br />&#160;<br />Sets the table background color (HTML color values). Do not use quotes.
|
|<pre><inputbox>
'''<font id="par_bgcolor" />bgcolor='''<br/>
''All types''
|width="30%"|Sets the table background color (HTML color values). Do not use quotes.
|
<pre>
<inputbox>
type=search
bgcolor=#eeeeff
</inputbox></pre>
</pre>
 
''produces:''
 
<inputbox>
type=search
bgcolor=#eeeeff
</inputbox>
|---
||'''width='''<br />''All types''<br />&#160;<br />Sets the width of the inputbox in characters.
|
|<pre><inputbox>
'''<font id="par_width" />width='''<br/>
''All types''
|width="30%"|Sets the width of the inputbox in characters, '''required''' for old browsers (see above).
|
<pre>
<inputbox>
type=create
width=624
</inputbox></pre>
</pre>
 
''produces:''
 
<inputbox>
type=create
width=624
</inputbox>
|---
||'''default='''<br />''All types''<br />&#160;<br />Default text to put in the inputbox.
|
|<pre><inputbox>
'''<font id="par_default" />default='''<br/>
''All types''
|width="30%"|Default text to put in the inputbox.
|
<pre>
<inputbox>
type=comment
default=User talk:Eloquence
</inputbox></pre>
</pre>
 
''produces:''
 
<inputbox>
type=comment
default=User talk:Eloquence
</inputbox>
|---
||'''preload='''<br />''comment'', ''create''<br />&#160;<br />The page under this title will be preloaded (see below) into the blank editbox when a new page is created.
|'''<font id="par_preload" />preload='''<br/>
|<pre><inputbox>
''comment'', ''create''
 
|width="30%"|The text of the page under this title will be loaded into the blank editbox when a new page is created. Enter the title of a non-existent page in the example inputbox, and click "Create" to test this effect.
|
<pre>
<inputbox>
type=create
width=20
preload=MediaWiki:Editthispage
</inputbox></pre>
</pre>
 
''produces:''
 
<inputbox>
type=create
width=20
preload=MediaWiki:Editthispage
</inputbox>
|---
|colspan="2"|Enter the title of a non-existent page in the example inputbox above or below, and click "Create article" or "Post a comment" respectively to test this effect.
|'''<font id="par_editintro" />editintro='''<br/>''comment'', ''create''
|-
|width="30%"|The text of the page under this title will be added, as instructions, ''before'' the submission form for '''new''' pages. Enter the title of a non-existent page in the example inputbox, and click "Create" to test this effect.
||'''editintro='''<br />''comment'', ''create''<br />&#160;<br />The text of the page under this title will be added, as instructions, ''before'' the submission form for '''new''' pages.
|
|<pre><inputbox>
<inputbox>
type=comment
width=20
editintro=MediaWiki:Missingcommenttext
</inputbox></pre>
</pre>
 
''produces:''
 
<inputbox>
type=comment
width=20
editintro=Mediawiki:Missingcommenttext
</inputbox>
|---
||'''<font id="par_buttonlabel" />buttonlabel='''<br />''All types''<br />&#160;<br />This label will be used for the main button of the form.
|<pre><inputbox>
|width="30%"|This label will be used for the main button of the form.
|
<pre>
<inputbox>
type=comment
buttonlabel=Add new rumor
</inputbox></pre>
</pre>
 
''produces:''
 
<inputbox>
type=comment
buttonlabel=Add new rumor
</inputbox>
|---
||'''<font id="par_searchbuttonlabel" />searchbuttonlabel='''<br />''search''<br />&#160;<br />This label will be used for the "Search full text" button of the search form.
|<pre><inputbox>
|width="30%"|This label will be used for the "Search full text" button of the search form.
|
<pre>
<inputbox>
type=search
searchbuttonlabel=Dig deeper
</inputbox></pre>
</pre>
 
''produces:''
 
<inputbox>
type=search
searchbuttonlabel=Dig deeper
</inputbox>
|---
||'''break='''<br />''All types''<br />&#160;<br />Whether or not to insert a line break between the input box and the button(s). Defaults to using the line break unless set to '''no'''.
|'''<font id="par_break" />break='''<br/>''yes''
|<pre><inputbox>
|width="30%"|Whether or not to insert a line break between the input box and the button(s). Defaults to using the line break unless set to '''no'''.
|
<pre>
<inputbox>
type=create
width=24
break=no
</inputbox></pre>
</pre>
 
''produces:''
 
<inputbox>
type=create
width=24
break=no
</inputbox>
Line 209 ⟶ 148:
Unfortunately <tt>preload</tt> does not yet work for the [[Special:Upload]] summary.
 
Please note that variables and templates are not supported in inputbox parameters.
==Caveats==
 
* Variables, parameters, and templates are not allowed in values of parameters of inputbox; see [[Template talk:Inputbox demo]].
==Preload==
Preloading can be done with an inputbox (see above), but also with a URL like
{{fullurl:m:abc|action=edit&preload=Template:Preload_demo}} which links to the edit box of a new page, preloaded with {{tim|Preload demo}}.
 
The wikitext of the preloaded page, including noinclude parts and tags but excluding includeonly tags, is loaded into the editbox if the target page does not exist yet. If the target of the preload operation already exists then only its wikitext is loaded, the preload command is ignored.
 
The fact that the includeonly tags are not included can be utilized by putting "subst:" inside them, to define a noinclude part (without using noinclude tags):
 
<nowiki>{{<includeonly>subst:</includeonly>#ifeq: {{<includeonly>subst:</includeonly>FULLPAGENAME}}| name&#160;of&#160;preloaded&#160;page| noinclude&#160;part| includeonly&#160;part}}</nowiki>
 
==Installation==
#Download and save the file [http://svn.wikimedia.org/viewvcsvnroot/mediawiki/trunk/extensions/inputbox/inputbox.php inputbox.php] to the ''extensions'' folder of your MediaWiki installation. <!-- This CVS version appears to be old and out of date; use the SVN version above instead: [http://wikipedia.cvs.sourceforge.net/*checkout*/wikipedia/extensions/inputbox/inputbox.php?revision=1.20 inputbox.php] to the ''extensions'' folder of your MediaWiki installation. Make sure you use this link to download the extension, as the latest version in CVS does not work with the current MediaWiki release branch. -->
#Open and edit the [[LocalSettings.php]] file by adding the following line near the bottom:
<pre>require_once(&quot;extensions/inputbox.php&quot;);</pre>
NOTE: Make sure that it is still above the closing php tag so that it looks like this:<pre>require_once(&quot;extensions/inputbox.php&quot;);
?></pre>
#May need to add the following [[User:Algorithm/actionCreate]]
require_once(&quot;extensions/inputbox.php&quot;);
?>
</pre>
<!-- I make the installation more specific because adding the require_once at the top of the LocalSettings.php file (still under the opening "<?php" tag didn't work for me. Putting the line near the bottom of the file did.-->
 
<!-- I make the installation more specific because adding the require_once at the top of the LocalSettings.php file (still under the opening "<?php" tag didn't work for me. Putting the line near the bottom of the file did.-->
==Examples==
*[[Template talk:New city in Morocco]].
*[[w:Wikipedia:Village pump (proposals)#User talk inputbox]]
 
{{h:f|langs=|enname=Inputbox}}
[[Category:MediaWiki extensions|Inputbox]]