Extension:InputBox

Uit HisGIS
Versie door interwiki>FWDekker op 18 jul 2019 om 18:49
(wijz) ← Oudere versie | Huidige versie (wijz) | Nieuwere versie → (wijz)
Naar navigatie springen Naar zoeken springen

<languages />

This extension comes with MediaWiki 1.21 and above. Thus you do not have to download it again. However, you still need to follow the other instructions provided.

[[Category:extensions bundled with MediaWiki 1.21{{#translation:}}]]

MediaWiki extensions manual
InputBox
Release status: stableLua-fout: callParserFunction: function "#translation" was not found.[[Category:stable extensions{{#translation:}}]]
Bestand:Simple Input Form.png
Implementation Lua-fout: callParserFunction: function "#translation" was not found.
Description <translate> Allows users to add predefined HTML forms to wiki pages</translate>
Author(s)
  • Erik Möller
  • Leonardo Pimenta
  • Rob Church
  • Trevor Parscal
  • Daniel Schuba
Latest version Lua-fout: callParserFunction: function "#translation" was not found.
MediaWiki 1.30+
Database changes No
License Lua-fout: callParserFunction: function "#translation" was not found.
Download [[Category:Extensions in Wikimedia version control{{#translation:}}]]
* <inputbox>
Translate the Extension:InputBox extension if it is available at translatewiki.net
Check usage and version matrix.
Issues Open tasks · Report a bug

[[Category:All extensions{{#translation:}}]]

<translate> The InputBox extension adds already created HTML forms to wiki pages.</translate> <translate> Users can "complete" a form (entering text, selecting menu items, etc.) by entering text into the box.

InputBox was originally created by <tvar|user>Erik Möller</> for the purpose of adding a <tvar|create-article>⧼Articleplaceholder-abouttopic-create-article-button⧽</> box to Wikinews.

Installation

</translate>

  • Download and place the file(s) in a directory called Extension:InputBox in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php: <syntaxhighlight lang="php">

wfLoadExtension( 'Extension:InputBox' );

</syntaxhighlight>

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension(). If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of <syntaxhighlight lang="php" inline="true">wfLoadExtension( 'Extension:InputBox' );</syntaxhighlight>, you need to use: <syntaxhighlight lang="php"> require_once "$IP/extensions/Extension:InputBox/Extension:InputBox.php"; </syntaxhighlight>

<translate>

Example

Box for starting a new article.

Wiki code

</translate>

<inputbox>
type=create
break=no
</inputbox>

<translate>

Result

</translate>

<inputbox> type=create break=no </inputbox>


<translate>

General syntax

Input boxes are constructed like this: </translate>

<source lang="html"><inputbox>

type= bgcolor= width= page= default= preload= editintro= buttonlabel= hidden= searchbuttonlabel= break= namespaces= prefix= placeholder= preloadparams[]= </inputbox> </source>

<translate> The <tvar|type>type</> parameter is mandatory.</translate> <translate> All other parameters are optional.</translate> <translate> <tvar|preloadparams>preloadparams[]</> can appear more than once.

Box types

The default location of the “<tvar|submit>Verzenden</>” button(s) is below the input box.


The “<tvar|submit>Verzenden</>” button can be moved to the right by using the line break parameter to eliminate the line break between the box and the button: <tvar|break>break=no</>.

Having the “<tvar|submit>Verzenden</>” button to the right is useful for search boxes when search suggestions would otherwise cover up a search button below the search box. </translate>

<translate> Type</translate> <translate> Example</translate> <translate> Description</translate>
type=search

<inputbox> type=search </inputbox>

<translate> Creates a search box which has a default width of 50 characters.</translate> <translate> Information added in the text box is searched for.</translate>
type=create

<inputbox> type=create </inputbox>

<translate> Creates a new page.</translate> <translate> Information added in the text box is the name of the page which is edited.</translate>
type=comment

<inputbox> type=comment </inputbox>

<translate> Adds a new section to the bottom of the page specified in the text box.</translate>
type=commenttitle

<inputbox> type=commenttitle page=Overleg:Extension:InputBox </inputbox>

default>default=</> parameter. The page has to be specified with <tvar|page>page=</> parameter.</translate> (introduced in rev:47203)
type=fulltext

<inputbox> type=fulltext </inputbox>

go>OK</>” button.</translate> (introduced in rev:45269)
type=move

<inputbox> type=move page=Extension:InputBox </inputbox>

<translate> Move a page to a different name.</translate> (introduced in gerrit:97559)

<translate> For <tvar|search2>type=search2</>, the default location for the search button is to the right.</translate> <translate> Currently, it does not seem to be possible to add other parameters to this type of input box.</translate> <translate> This search box searches the entire wiki that it is placed on. </translate>

<translate> Type</translate> <translate> Example</translate>
type=search2

<inputbox> type=search2 </inputbox>

<translate>

Parameters

</translate>

<translate> Parameter</translate> <translate> Description</translate> <translate> Scope</translate> <translate> Compatibility</translate> <translate> Example</translate> <translate> Result</translate>
bgcolor= <translate> Sets the table background color (HTML color values).</translate> <translate> Do not use quotes.</translate> <translate> All types</translate> ?
<inputbox>
type=search
bgcolor=#eeeeff
</inputbox>
<inputbox>

type=search bgcolor=#eeeeff </inputbox>

width= <translate> Sets the width of the InputBox in characters.</translate> <translate> All types</translate> ?
<inputbox>
type=create
width=24
</inputbox>
<inputbox>

type=create width=24 </inputbox>

default= <translate> Default text to put in the InputBox.</translate> <translate> All types</translate> ?
<inputbox>
type=comment
default=User talk:Eloquence
</inputbox>
<inputbox>

type=comment default=User talk:Eloquence </inputbox>

preload= 1>Manual:Creating pages with preloaded text </>) into the blank editbox when a new page is created.</translate> create, comment, commenttitle ?
<inputbox>
type=create
preload=Log
</inputbox>
<inputbox>

type=create preload=Log </inputbox>

<translate> Enter the title of a non-existent page in the example InputBox above or below, and click "<tvar|create>⧼inputbox-createarticle⧽</>" or "<tvar|new>⧼inputbox-postcomment⧽</>" respectively to test this effect.</translate>
editintro= <translate> The page which is given under this parameter will be shown, as instructions, above the editing window.</translate> create, comment ?
<inputbox>
type=comment
editintro=MediaWiki:Missingcommenttext
</inputbox>
<inputbox>

type=comment editintro=Mediawiki:Missingcommenttext </inputbox>

buttonlabel= <translate> This label will be used for the main button of the form.</translate> <translate> All types</translate> ?
<inputbox>
type=comment
buttonlabel=Add new rumor
</inputbox>
<inputbox>

type=comment buttonlabel=Add new rumor </inputbox>

hidden= <translate>

This specifies that there is no InputBox.

It is used with parameter "<tvar|default>default</>", now not being a default, but the fixed value of the name of the page.</translate>

create, comment ?
<inputbox>
type=comment
editintro=Extension:InputBox/editintro comment
preload=Extension:InputBox/preload
hidden=yes
default=Extension talk:InputBox
buttonlabel=<translate><!--T:60--> Post a comment on the talk page</translate>
</inputbox>
<inputbox>

type=comment editintro=Extension:InputBox/editintro comment preload=Extension:InputBox/preload hidden=yes default=Extension talk:InputBox buttonlabel=<translate> Post a comment on the talk page</translate> </inputbox>

searchbuttonlabel= <translate> This label will be used for the "Search full text" button of the search form.</translate> search, fulltext ?
<inputbox>
type=search
searchbuttonlabel=<translate><!--T:63--> Dig deeper</translate>
</inputbox>
<inputbox>

type=search searchbuttonlabel=<translate> Dig deeper</translate> </inputbox>

fulltextbutton= <translate> Show the full text search button on search2 form</translate> search2 ?
<inputbox>
type=search2
searchbuttonlabel=<translate><!--T:66--> Dig deeper</translate>
fulltextbutton=true
</inputbox>
<inputbox>

type=search searchbuttonlabel=<translate> Dig deeper</translate> fulltextbutton=true </inputbox>

labeltext= <translate> Text to print beside the button</translate> search2 ?
<inputbox>
type=search2
searchbuttonlabel=<translate><!--T:69--> Dig deeper</translate>
labeltext=<translate><!--T:70--> Look for:</translate> 
</inputbox>
<inputbox>

type=search2 searchbuttonlabel=<translate> Dig deeper</translate> labeltext=<translate> Look for:</translate> </inputbox>

break= yes>yes</> (use a line break).</translate> <translate> All types</translate> ?
<inputbox>
type=create
width=24
break=no
</inputbox>
<inputbox>

type=create width=24 break=no </inputbox>

namespaces= <translate>

Support for namespace checkboxes in fulltext search.

With "<tvar|main>Main**</>", main article namespace is checked by default.</translate>

search, fulltext ?
<inputbox>
type=search
namespaces=Main**,Help
</inputbox>
<inputbox>

type=search namespaces=Main**,Help </inputbox>

prefix=

<translate>

  • Narrow down search to pages beginning with certain prefix.</translate> <translate> Note this only works with certain search back-ends, currently only <tvar|ext>Extension:CirrusSearch </>.</translate> <translate> Defaults to empty string (search all pages).</translate>

<translate>

  • Create new page beginning with a certain prefix.</translate>

<translate>

  • In <tvar|tmove>type=move</>, the prefix is prepended to the default parameter.

Remark: underscores aren't recognized as spaces. </translate>

search, fulltext, create ?
<inputbox>
type=search
prefix={{FULLPAGENAME}}/Archive
</inputbox>
<inputbox>

type=search prefix=Extension:InputBox/Archive </inputbox>

<translate> The button below prefixes the name with <tvar|mypage>Special:Mypage/</>.</translate> <inputbox> type=create preload=Template:Article wizard/userpageskeleton default=new article name here prefix=Special:Mypage/ editintro=Wikipedia:Article wizard/Wizard-New edit instructions userdraft buttonlabel=<translate> Create a userspace draft</translate> width=50 </inputbox>

placeholder= <translate> Define placeholder text that will display in the input box when it is empty.</translate> <translate> All types</translate> 1.19+
<inputbox>
type=search
placeholder=<translate><!--T:88--> Search this Wiki</translate>
</inputbox>
<inputbox>

type=search placeholder=<translate> Search this Wiki</translate> </inputbox>

page= <translate> Page to posts comment to, or page to move.</translate> comment, move
<inputbox>
type=comment
page=Project:Sandbox
</inputbox>
<inputbox>

type=comment page=Project:Sandbox </inputbox>

minor= <translate> Minor edit.</translate> comment, create
<inputbox>
type=comment
page=Project:Sandbox
minor=true
</inputbox>
<inputbox>

type=comment page=Project:Sandbox minor=true </inputbox>

nosummary= <translate> Edit summary (headline) not required for new comment.</translate> comment
<inputbox>
type=comment
page=Project:Sandbox
nosummary=true
</inputbox>
<inputbox>

type=create page=Project:Sandbox nosummary=true </inputbox>

summary= <translate> Edit summary or move reason.</translate> create, move
<inputbox>
type=create
default=Special:Mypage/inputbox test
summary=Foo
</inputbox>
<inputbox>

type=create default=Special:Mypage/inputbox test summary=Foo </inputbox>

id= form><form></>.</translate> <translate> All types</translate> <translate> 1.23 for some types</translate>
<inputbox>
type=comment
page=Project:Sandbox
summary=Foo
id=bar
</inputbox>
<inputbox>

type=comment page=Project:Sandbox summary=Foo id=bar </inputbox>

inline= <translate> Make the InputBox be an inline element (no line break at beginning).</translate> search2
<translate><!--T:98--> Text here:</translate> <inputbox>
type=search2
inline=true
width=10
</inputbox>
<translate> Text here:</translate> <inputbox>

type=search2 inline=true width=10 </inputbox>

dir= <translate> Right to left (rtl) or left to right (ltr).</translate> <translate> Defaults to directionality of the page's language.</translate> <translate> All types</translate>
<inputbox>
dir=rtl
type=comment
page=Project:Sandbox
summary=Foo
</inputbox>
<inputbox>

dir=rtl type=comment page=Project:Sandbox summary=Foo </inputbox>

preloadparams[]= <translate> Specify parameters to the preload text.</translate> <translate> See [[<tvar|man>Manual:Creating pages with preloaded text#Using parameters</>|Creating pages with preloaded text]].</translate> create, comment, commenttitle 1.25+
<inputbox>
type=create
preload=Log
preloadparams[]=param1
preloadparams[]=param2
</inputbox>
<inputbox>

type=create preload=Log preloadparams[]=param1 preloadparams[]=param2 </inputbox>

searchfilter= <translate> Specify parameters to append to the search</translate> search 1.30+
<inputbox>
type=search
searchfilter=insource:foo
</inputbox>
<inputbox>

type=search searchfilter=insource:foo </inputbox>

useve= <translate> When creating a page the input box will use the new visual editor, if the extension is installed, and this parameter is set to true.</translate> create, comment
<inputbox>
type=create
break=no
useve=true
</inputbox>
<inputbox>

type=create break=no useve=true </inputbox>

<translate> Applying <tvar|create>create</> to an existing page simply gives the edit page.</translate> <translate> In that case <tvar|preload>preload</> is ignored.</translate> <translate> Applying <tvar|comment>comment</> for a new page works.

The texts taken from the <tvar|mediawiki>MediaWiki:</> namespace are of course only examples, any existing page can be used for <tvar|editintro>editintro</> or <tvar|preload>preload</>.</translate> <translate> Unfortunately <tvar|preload>preload</> does not yet work for the [[<tvar|special>Special:Upload</>|Upload]] summary.

Alignment

If you want to create an inputbox on the right side of the page, do something like: </translate>

<syntaxhighlight lang="html">

<inputbox> type=create </inputbox>

</syntaxhighlight>

<inputbox> type=create </inputbox>

<translate>

Parser function

Using InputBox in a template

In order to create many similar input boxes, InputBox can be used in a template.</translate> <translate> However, passing template parameters to InputBox parameters only works if the <tvar|inputbox><inputbox>...</inputbox></> tag is written as <tvar|inputbox2>{{#tag:inputbox | ...}}</> inside the template.

The following example is a template to create a new wiki page from a named template: </translate>

<source lang=moin> <inputbox> type=create buttonlabel=<translate> Create new article</translate> preload=Template:Article </inputbox> </source>

<translate> When instantiating the template, the first parameter gives the item that is created (default: <tvar|article>article</>) as spelled out in the button, the second parameter gives the name of the template used to create the item (default: <tvar|template>Template:Article</>).

E.g., the code for an input box to create a new project from a project template might look like this: </translate>

<source lang=moin> Sjabloon:CreateNew </source>

<translate>

See also

</translate>

[[Category:Skins used on Wikimedia{{#translation:}}|Extension:InputBox]]

[[Category:Form extensions{{#translation:}}]] [[Category:Page creation extensions{{#translation:}}]] [[Category:Search widget extensions{{#translation:}}]] [[Category:Edit box extensions{{#translation:}}]]