Extension:FormInputMik

MediaWiki extensions manual
FormInputMik
Release status: unmaintained
Implementation Tag , Page action , Search
Description Allows users to use forminput and formlink in a single button.
Author(s) Michele Fella <michele.fella@gmail.com> (Michele.Fellatalk)
Latest version 0.1.0 (2014-04-28)
MediaWiki 1.19+
Database changes No
License Public domain
Download
<forminputmik>

The FormInputMik extension adds a input textbox and a submit button to wiki pages alike the ones generated by semantic forminput. Users can define the page name they want to edit (autocomplete is provided on predefined namespace) by entering text into the box.

When clicking on the submit button:

  1. if the page exists they will be redirected to the page edit
  2. if the page does not exists (or the text is blank) they will be redirected to the formlink page

It was adapted by Mik for the purpose of having a single button to add/edit page and avoid users to override existing pages with formlink.

This extension is based on InputBox extension source code. ..hopefully one day I will be able to merge my changes to the original project. Mik

Installation

edit
  • Download and place the file(s) in a directory called FormInputMik in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    require_once "$IP/extensions/FormInputMik/FormInputMik.php";
    
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Example

edit
 
FormInputMik output example

Wiki code

edit
<forminputmik>
type=create
break=no
width=70
form=People
search on namespace=People
placeholder=Type the contact name to check if it already exists
buttonlabel=Submit
newwin=true
bgcolor=aqua
</forminputmik>

General syntax

edit

FormInputMik are constructed like this:

<forminputmik>
type=
form=
search on namespace=
bgcolor=
width=
buttonlabel=
break=
placeholder=
newwin=
</forminputmik>

The type parameter is mandatory and the only allowed value is create.

The form parameter is mandatory and defines the form to be used for adding/editing the page.

The search on namespace parameter is mandatory and defines the namespace for autocomplete the page names.

Parameters

edit
Parameter Description Scope Compatibility Example Result
bgcolor= Sets the table background color (HTML color values). Do not use quotes. All types ?
<forminputmik>
type=create
form=formname
search on namespace=namespacename
bgcolor=#eeeeff
</forminputmik>
<forminputmik>

type=create form=formname search on namespace=namespacename bgcolor=#eeeeff </forminputmik>

width= Sets the width of the input box in characters. All types ?
<forminputmik>
type=create
form=formname
search on namespace=namespacename
width=24
</forminputmik>
<forminputmik>

type=create form=formname search on namespace=namespacename width=24 </forminputmik>

buttonlabel= This label will be used for the main button of the form. All types ?
<forminputmik>
type=create
form=formname
search on namespace=namespacename
buttonlabel=Add new page
</forminputmik>
<forminputmik>

type=create form=formname search on namespace=namespacename buttonlabel=Add new page </forminputmik>

break= Whether or not to insert a line break between the input box and the button(s). Defaults to yes (use a line break). All types ?
<forminputmik>
type=create
form=formname
search on namespace=namespacename
width=24
break=no
</forminputmik>
<forminputmik>

type=create form=formname search on namespace=namespacename width=24 break=no </forminputmik>

search on namespaces= Support for namespace checkboxes in fulltext search.
With "Namespace**" it is checked by default.
search, fulltext ?
<forminputmik>
type=create
form=formname
search on namespace=namespacename
namespaces=Main**,Help
</forminputmik>
<forminputmik>

type=create form=formname search on namespace=namespacename namespaces=Main**,Help </forminputmik>

placeholder= Define placeholder text that will display in the input box when it is empty. All types 1.19+
<forminputmik>
type=create
form=formname
search on namespace=namespacename
placeholder=some text here
</forminputmik>
<forminputmik>

type=create form=formname search on namespace=namespacename placeholder=some text here </forminputmik>

newwin= Define whether or not the form should be opened in a new window. (use newwin=true). All types 1.19+
<forminputmik>
type=create
form=formname
search on namespace=namespacename
newwin=true
</forminputmik>
<forminputmik>

type=create form=formname search on namespace=namespacename newwin=true </forminputmik>

See also

edit