Extensão:InputBox
InputBox Estado da versão: estável |
|
---|---|
![]() |
|
Implementação | Marcação , Ações de página , Sistema de pesquisa |
Descrição | Permite adicionar formulários HTML predefinidos em páginas |
Autor(es) |
|
Última versão | Continuous updates |
MediaWiki | 1.30+ |
Modifica o banco de dados |
Não |
Licença | Licença MIT |
Download | |
* <inputbox> |
|
Para traduzir a extensão InputBox, verifique sua disponibilidade no translatewiki.net | |
Problemas | Tarefas em aberto · Relatar um bug |
A extensão InputBox adiciona formulários HTML já criados em páginas. O usuário pode “completar” um formulário (digitando, selecionando itens, etc.) inserindo texto na caixa.
Ela foi criada originalmente por Erik Möller, no propósito de adicionar a caixa Criar um artigo ao Wikinotícias.
Instalação
- Baixe e coloque o(s) arquivo(s) num diretório chamado
InputBox
na sua pastaextensions/
. - Adicione o seguinte código ao final do seu arquivo LocalSettings.php:
wfLoadExtension( 'InputBox' );
Concluído – Navegue à página Special:Version em sua wiki para verificar se a instalação da extensão foi bem sucedida.
Para usuários executando o MediaWiki 1.24 ou anteriores:
As instruções acima descrevem a nova forma de instalar essa extensão utilizando wfLoadExtension()
.
Se precisar instalar essa extensão em versões antigas (MediaWiki 1.24 e anteriores), em vez de wfLoadExtension( 'InputBox' );
, você precisa usar:
require_once "$IP/extensions/InputBox/InputBox.php";
Exemplo
Caixa para iniciar um novo artigo.
Código wiki
<inputbox> type=create break=no </inputbox>
Resultado
Sintaxe geral
Caixas de inserção são construídas desta maneira:
<inputbox>
type=
bgcolor=
width=
page=
default=
preload=
editintro=
buttonlabel=
hidden=
searchbuttonlabel=
fulltextbutton=
labeltext=
break=
namespaces=
prefix=
placeholder=
minor=
nosummary=
summary=
id=
inline=
dir=
preloadparams[]=
searchfilter=
useve=
arialabel=
</inputbox>
|
O parâmetro type é obrigatório. Todos os outros são opcionais. preloadparams[] pode aparecer mais de uma vez.
Tipos de caixas
O local padrão do(s) botão(ões) “Enviar” é abaixo da caixa de inserção.
O botão “Enviar” pode ser movido para a direita usando o parâmetro de quebra de linha para eliminar a quebra de linha entre a caixa e o botão: break=no
.
Para caixas de pesquisa, ter o botão “Enviar” à direita é útil ao passo que as sugestões cobririam o botão na caixa de pesquisa.
Tipo | Exemplo | Descrição |
---|---|---|
type=search | Cria uma caixa de pesquisa com um comprimento padrão de 50 caracteres. Pesquisa-se as informações adicionadas à caixa. | |
type=create | Cria uma nova página. Informações adicionadas à caixa tornam-se o nome da página criada. | |
type=comment | Adiciona uma nova seção ao final da página especificada na caixa. | |
type=commenttitle | Adiciona uma nova seção com o cabeçalho inserido na caixa. O título pode ser especificado com o parâmetro default= . A página, com o parâmetro page= . (introduzido na rev:47203)
| |
type=fulltext | Pesquisa apenas com o botão de pesquisa, sem o botão “Ir”. (introduzido na rev:45269) | |
type=move | Move uma página para um nome diferente. (introduzido na gerrit:97559) |
Para type=search2
, a localização padrão do botão de pesquisa é à direita.
Atualmente, não parece ser possível adicionar outros parâmetros a esse tipo de caixa de inserção.
Esta caixa de pesquisa procura o inserido por toda a wiki.
Tipo | Exemplo |
---|---|
type=search2 |
Parâmetros
Parâmetro | Descrição | Escopo | Compatibilidade | Exemplo: | Resultado | |
---|---|---|---|---|---|---|
arialabel= | Supply the aria-label attribute to the inputbox to allow generated markup be accessible to screen readers | Todos os tipos |
|
<inputbox> type=search arialabel=Search the Wiki </inputbox> |
||
bgcolor= | Define a cor do plano de fundo (valores de cores HTML). Não use aspas. | Todos os tipos | ? | <inputbox> type=search bgcolor=#eeeeff </inputbox> |
||
width= | Define a largura da InputBox em caracteres. | Todos os tipos | ? | <inputbox> type=create width=24 </inputbox> |
||
default= | Texto padrão para inserir o InputBox. | Todos os tipos | ? | <inputbox> type=comment default=User talk:Eloquence </inputbox> |
||
preload= | The page under this title will be preloaded (see Manual:Creating pages with preloaded text ) into the blank editbox when a new page is created. | create, comment, commenttitle | ? | <inputbox> type=create preload=Log </inputbox> |
||
Enter the title of a non-existent page in the example InputBox above or below, and click "Criar página" or "Nova seção" respectively to test this effect. | ||||||
editintro= | The page which is given under this parameter will be shown, as instructions, above the editing window. | create, comment | ? | <inputbox> type=comment editintro=MediaWiki:Missingcommenttext </inputbox> |
||
buttonlabel= | This label will be used for the main button of the form. | All types | ? | <inputbox> type=comment buttonlabel=Add new rumor </inputbox> |
||
hidden= | This specifies that there is no InputBox.
It is used with parameter "default", now not being a default, but the fixed value of the name of the page. |
create, comment | ? | <inputbox> type=comment editintro=Extension:InputBox/editintro comment preload=Extension:InputBox/preload hidden=yes default=Extension talk:InputBox buttonlabel=Post a comment on the talk page </inputbox> |
||
searchbuttonlabel= | This label will be used for the "Search full text" button of the search form. | search, fulltext | ? | <inputbox> type=search searchbuttonlabel=Dig deeper </inputbox> |
||
fulltextbutton= | Show the full text search button on search2 form | search2 | ? | <inputbox> type=search2 searchbuttonlabel=Dig deeper fulltextbutton=true </inputbox> |
||
labeltext= | Text to print beside the button | search2 | ? | <inputbox> type=search2 searchbuttonlabel=Dig deeper labeltext=Look for: </inputbox> |
||
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 | ? | <inputbox> type=create width=24 break=no </inputbox> |
||
namespaces= | Support for namespace checkboxes in fulltext search.
With " |
search, fulltext | ? | <inputbox> type=search namespaces=Main**,Help </inputbox> |
||
prefix= |
Remark: underscores aren't recognized as spaces. |
search, fulltext, create | ? | <inputbox> type=search prefix={{FULLPAGENAME}}/Archive </inputbox> |
The button below prefixes the name with | |
placeholder= | Define placeholder text that will display in the input box when it is empty. | All types |
|
<inputbox> type=search placeholder=Search this Wiki </inputbox> |
||
page= | Page to posts comment to, or page to move. | comment, move | <inputbox> type=comment page=Project:Sandbox </inputbox> |
|||
minor= | Minor edit. | comment, create | <inputbox> type=comment page=Project:Sandbox minor=true </inputbox> |
|||
nosummary= | Edit summary (headline) not required for new comment. | comment | <inputbox> type=comment page=Project:Sandbox nosummary=true </inputbox> |
|||
summary= | Edit summary or move reason. | create, move | <inputbox> type=create default=Special:Mypage/inputbox test summary=Foo </inputbox> |
|||
id= | id attribute for <form>. | All types |
|
<inputbox> type=comment page=Project:Sandbox summary=Foo id=bar </inputbox> |
||
inline= | Make the InputBox be an inline element (no line break at beginning). | search2 | Text here: <inputbox> type=search2 inline=true width=10 </inputbox> |
Text here: | ||
dir= | Right to left (rtl) or left to right (ltr). Defaults to directionality of the page's language. | All types | <inputbox> dir=rtl type=comment page=Project:Sandbox summary=Foo </inputbox> |
|||
preloadparams[]= | Specify parameters to the preload text. See Creating pages with preloaded text. | create, comment, commenttitle |
|
<inputbox> type=create preload=Log preloadparams[]=param1 preloadparams[]=param2 </inputbox> |
||
searchfilter= | Specify parameters to append to the search | search |
|
<inputbox> type=search searchfilter=insource:foo </inputbox> |
||
useve= | 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. | create, comment | <inputbox> type=create break=no useve=true </inputbox> |
Applying create to an existing page simply gives the edit page.
In that case preload
is ignored.
Applying comment for a new page works.
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 Upload summary.
Alignment
If you want to create an inputbox on the right side of the page, do something like:
<div style="float:{{dir|{{pagelang}}|left|right}}; width:42em">
<inputbox>
type=create
</inputbox>
</div>
Parser function
Using InputBox in a template
In order to create many similar input boxes, InputBox can be used in a template.
However, passing template parameters to InputBox parameters only works if the <inputbox>...</inputbox>
tag is written as {{#tag:inputbox | ...}}
inside the template.
The following example is a template to create a new wiki page from a named template:
{{#tag:inputbox |
type=create
buttonlabel=Create new {{{1|article}}}
preload={{{2|Template:Article}}} }}
When instantiating the template, the first parameter gives the item that is created (default: article
) as spelled out in the button, the second parameter gives the name of the template used to create the item (default: Template:Article
).
E.g., the code for an input box to create a new project from a project template might look like this:
{{Template:CreateNew|project|Template:Project}}
See also
![]() | Esta extensão está sendo usado por um ou mais projetos da Wikimedia. Isto significa que, provavelmente, a extensão é estável e funciona bem o suficiente para ser utilizada em sites de alto tráfego. Procure pelo nome dessa extensão nos arquivos de configuração CommonSettings.php e InitialiseSettings.php da Wikimedia para verificar onde ela foi instalada. Uma lista completa das extensões instaladas numa wiki em particular podem ser visualizadas na página Special:Version da wiki. |
- Extensions bundled with MediaWiki 1.21/pt-br
- Stable extensions/pt-br
- Tag extensions/pt-br
- Page action extensions/pt-br
- Search extensions/pt-br
- MIT licensed extensions/pt-br
- Extensions in Wikimedia version control/pt-br
- MediaWikiPerformAction extensions/pt-br
- ParserFirstCallInit extensions/pt-br
- SpecialPageBeforeExecute extensions/pt-br
- All extensions/pt-br
- Extensions used on Wikimedia/pt-br
- Form extensions/pt-br
- Page creation extensions/pt-br
- Search widget extensions/pt-br
- Edit box extensions/pt-br