Jump to content

Ajuda:Extensão: TemplateWizard

From mediawiki.org
This page is a translated version of the page Help:Extension:TemplateWizard and the translation is 66% complete.

O que é o TemplateWizard?

O TemplateWizard é uma extensão do MediaWiki que proporciona uma janela emergente para a barra de ferramentas do 'Editor da Wiki' para inserir modelos no Texto Wiki (Wikitext) .

Como é que eu utilizo TemplateWizard?

  • Para utilizar o TemplateWizard, abra uma página da wiki para editar utilizando o editor Wikitext (não o editor Wikitext 2017)
  • Coloque o cursor na localização em que pretende inserir o modelo. Depois clique no ícone Puzzle na barra de ferramentas -
  • Será aberta uma janela

Como é que eu encontro um modelo?

Passos para encontrar um modelo:

  1. procurá-lo através da caixa de pesquisa
  2. selecione a partir da sua lista de favoritos
  3. explore as categorias de modelos

Para detalhes, consulte o documento de descobrir um modelo .

  • Comece a digitar o nome de um modelo, e verá uma lista de modelos para escolher.
  • Nota: Apenas os modelos que têm TemplateData terão descrições. Nós aconselhamos que adicione TemplateData aos modelos.
  • When you find the template you're looking for, click on it (or navigate to it with your arrow keys) and press ↵ Enter.

This will take you to the data-entry form.

  • If you use a template often, and have previously favourited it, you can select it from the list of your favourited templates, which can be found in the Favoritos tab below the search field.


Como é que eu adiciono dados no meu modelo escolhido? =

  • The title bar of the dialog window shows a 'back' button with which to close the template form and return to search.
  • Below that is the top bar, which contains the template title, description, and a link to the template's wiki page.
  • The left-side list of parameters, divided into up to three parts for required, suggested, and optional parameters. This area also has a button at the bottom with which to add or remove all non-required fields at once. Note that some templates have no parameters, and in these cases nothing will be listed here. When you click on a template parameter, it gets added to the right side.
  • The right-side form containing the actual data-entry fields into which you put the values that will be added to the wikitext. Only those parameters that are listed here will be inserted into the editing area (including those that contain no value, as templates can treat this differently from the parameter not being present at all).
  • You can click on the info icons above the template fields to read more information about them.

  • TemplateWizard works most effectively with templates that have TemplateData defined: i.e. their parameters have been documented in a detailed and structured way, including default values etc. (information about how to do that is in the TemplateData help pages). It also works without TemplateData definitions, although with some reduced functionality. These two modes are described in the next two sections.
  • Only required fields are added by default
  • Popups for field information
  • Auto-complete for page names on the wiki
  • Auto-complete for files from Commons
  • Custom field inputs for dates, long-form text fields, numbers etc.


Utilizar TemplateWizard com TemplateData

There are seven different types of field used in TemplateWizard, based on the parameter type defined in the TemplateData.

Name[fn 1] Type[fn 2] Campo utilizado Notas
1. Número number NumberInputWidget
2. Data date DateInputWidget
3. Utilizador wiki-user-name UserInputWidget
4. Página wiki-page-name TitleInputWidget Para qualquer nome de página (incluindo os ficheiros).
5. Ficheiro wiki-file-name TitleInputWidget Limitado a títulos no espaço nominal do 'Ficheiro', e exibido com imagens em miniatura.
6. Modelo wiki-template-name TitleInputWidget Limitado a títulos no espaço nominal do 'Modelo'
7. "Algo mais" TextInputWidget Todos os outros tipos serão exibidos como entradas de entrada de texto padrão, e aceitarão qualquer texto.
  1. The name as used in the TemplateData form.
  2. The type as used in the TemplateData JSON.

O próprio TemplateData suporta mais tipos de campo do que os listados em cima. Alguns destes podem ser adicionados no T200664.

Utilizar TemplateWizard com TemplateData

If a template does not have any TemplateData, then an attempt will be made to guess the names of its parameters, and these will be presented as standard text entry form fields with labels as they are guessed.

Note that it is likely that there will be duplicated, deprecated, or missing parameters in this list, because template authors will do things such as the following to allow different forms of a parameter name: {{{full name|{{{Full Name}}}}}} (note the difference in letter case). It is common for there to be a prefered form for a parameter, and this can only be found by viewing the template documentation (and, while you're there, maybe adding TemplateData, so other people aren't confused in the future!).

Como é que eu insiro o modelo?

When you've added all desired parameters to the template form and given them their values (including no value at all if you need an empty parameter), click the 'Submit' button at the top right of the dialog window and the template wikitext will be inserted at the cursor's current location in the main page editing box.

Template text will be inserted according to the format defined in TemplateData; if none is given then the 'inline' format will be used. It is not possible to have a different custom format for one template (but of course the template wikitext can always be edited after insertion).

Consultar também