Difference between revisions of "Help:Inputbox"
m (1 revision(s)) |
(→Box types) |
(No difference)
|
Latest revision as of 21:25, 7 July 2006
The inputbox extension is a MediaWiki extension by Erik Möller to add predefined HTML forms to wiki pages. It was originally created for the purpose of adding a Create an article box to Wikinews. It requires MediaWiki 1.5 and an extensions script (see Installation below).
General syntax
Inputboxes are constructed like this:
<inputbox> type=box type parameter1=value parameter2=value </inputbox>
The type parameter is mandatory. All other parameters are optional.
Box types
Type | Example |
---|---|
type=search |
<inputbox> type=search </inputbox> |
Generates a search box with a default width of 50 characters. The button labels can be specified, see below; defaults MediaWiki:Tryexact and MediaWiki:Searchfulltext. The text field specifies the search criteria. | |
type=create |
<inputbox> type=create </inputbox> |
Allows creating a new page. The button label can be specified, see below; default MediaWiki:Createarticle. The text field specifies which page is to be edited. | |
type=comment |
<inputbox> type=comment </inputbox> |
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
Parameter Scope |
Example |
---|---|
bgcolor= All types Sets the table background color (HTML color values). Do not use quotes. |
<inputbox> type=search bgcolor=#eeeeff </inputbox> <inputbox> type=search bgcolor=#eeeeff </inputbox> |
width= All types Sets the width of the inputbox in characters. |
<inputbox> type=create width=24 </inputbox> <inputbox> type=create width=24 </inputbox> |
default= All types Default text to put in the inputbox. |
<inputbox> type=comment default=User talk:Eloquence </inputbox> <inputbox> type=comment default=User talk:Eloquence </inputbox> |
preload= comment, create The page under this title will be preloaded (see below) into the blank editbox when a new page is created. |
<inputbox> type=create preload=MediaWiki:Editthispage </inputbox> <inputbox> type=create preload=MediaWiki:Editthispage </inputbox> |
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. | |
editintro= comment, create The text of the page under this title will be added, as instructions, before the submission form for new pages. |
<inputbox> type=comment editintro=MediaWiki:Missingcommenttext </inputbox> <inputbox> type=comment editintro=Mediawiki:Missingcommenttext </inputbox> |
buttonlabel= All types This label will be used for the main button of the form. |
<inputbox> type=comment buttonlabel=Add new rumor </inputbox> <inputbox> type=comment buttonlabel=Add new rumor </inputbox> |
searchbuttonlabel= search This label will be used for the "Search full text" button of the search form. |
<inputbox> type=search searchbuttonlabel=Dig deeper </inputbox> <inputbox> type=search searchbuttonlabel=Dig deeper </inputbox> |
break= All types 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. |
<inputbox> type=create width=24 break=no </inputbox> <inputbox> type=create width=24 break=no </inputbox> |
Applying create to an existing page simply gives the edit page. In that case editintro and preload are ignored. Applying comment for a new page works, if the page already exists editintro is ignored.
The texts taken from the MediaWiki: namespace are of course only examples, any existing page can be used for editintro or preload. Unfortunately preload does not yet work for the Special:Upload summary.
Please note that variables and templates are not supported in inputbox parameters.
Preload
Preloading can be done with an inputbox (see above), but also with a URL like http://meta.wikimedia.org/wiki/abc?action=edit&preload=Template:Preload_demo which links to the edit box of a new page, preloaded with template:Preload demo ( talk edit history links ).
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):
{{<includeonly>subst:</includeonly>#ifeq: {{<includeonly>subst:</includeonly>FULLPAGENAME}}| name of preloaded page| noinclude part| includeonly part}}
Installation
- Download and save the file inputbox.php to the extensions folder of your MediaWiki installation.
- Open and edit the LocalSettings.php file by adding the following line near the bottom:
require_once("extensions/inputbox.php");
NOTE: Make sure that it is still above the closing php tag so that it looks like this:
require_once("extensions/inputbox.php"); ?>
- May need to add the following User:Algorithm/actionCreate
http://www.fayeunrauphotography.com/ kjøp cialis 520853 http://www.primetermites.com/ ジェネリックバイアグラ 5575 http://www.witch-ring.com/Generic-Viagra/ Comprando viagra sfnjy http://www.flweaver.com/ online Cialis kmt http://www.blogdemoteros.com/ tadalafil 5271