Help:TemplateData/hu

A  kiterjesztés lehetővé teszi információk tárolását egy wikiszövegsablonról és paramétereiről géppel olvasható formában, így különböző szerkesztőfelületek lekérhetik és megjeleníthetik azokat a sablonszerkesztőikben – ezáltal megkönnyítve a szerkesztőknek sablonok hozzáadását lapokhoz, illetve módosításukat.

2019 áprilisa óta a TemplateData része a sablonbeillesztőnek, így elérhető minden szerkesztőnek (beleértve a nem regisztráltakat is) az összes Wikimédia-wikin. Mind az alapértelmezett wikiszöveges, mind a vizuális szerkesztő tartalmazza, ahogy számos szkript, eszköz és segédeszköz is. Ha szeretnéd e funkciót a saját wikiden, akkor telepítened kell a kiterjesztést.

Adding template data to a template for this extension to use involves inserting a small, simple block of JSON (explained below) into the template's documentation page. Ezt kézzel vagy a sablonadat-szerkesztővel, egy, a TemplateData kiterjesztéssel rendelkező wikiken a sablon „”/„” lapjain keresztül hozzáférhető grafikus felhasználói felülettel is megteheted. The JSON contains a list of the template's parameters and information about those parameters and about the template as a whole (see below for details).

Templates that contain template data will display this information in the user interface when a user adds the template. In some cases, it will change how the editor behaves when you use it to edit or insert a given template, making it much easier for users to perform the steps needed to add a given template.

Történet
Template data was originally developed in early 2013 with in mind, which was in MediaWiki testing stages at the time. The visual editor is the main visual editing interface for Wikimedia wikis, and template data allows it to have a more useful interface when adding templates. It was officially supported by the visual editor immediately. As the visual editor was rolled out to the various major Wikimedia wikis as a default feature from 2013 through 2016, template data became a part of them as well.

2016 decemberében a vizuális szerkesztőfelület béta funkcióként elérhetővé vált forrásszöveg-szerkesztésre. Ezt elnevezték -nek. This brought the features of template data to source editing for the first time.

In March 2018, Sam Wilson developed, a GUI template editor extension for the default Wikimedia source editor, (otherwise known as the 2010 wikitext editor), designed to make the process of adding templates easier by using information from template data. In April 2019, TemplateWizard was made a default part of the 2010 wikitext editor on all Wikimedia wikis. This meant that template data was now a default part of both the visual editor and the source editor on Wikimedia wikis.



TemplateData hozzáadása vagy szerkesztése
Sablonadat hozzáadásához vagy szerkesztéséhez először menj el a sablon lapjához a „/Sablon:Sablonnév” címen.



A jelenlegi állapot ellenőrzése
Before adding or editing template data, check whether the template has a documentation subpage. Then check whether the template already contains template data and, if so, whether it's located on the template page or the documentation subpage.



Dokumentációs allapok
There are two main ways templates on most Wikimedia wikis store their usage notes and other data that shouldn't be included in the actual template itself, like categories the template should be contained in:

On pages like this, the {{}} template transcludes all the /doc page's content onto the template page, keeping the template's source code much cleaner.
 * The vast majority of templates keep usage notes and other data that doesn't belong on the template page itself on a documentation subpage: "/Template:Templatename/doc".
 * On templates with documentation subpages, the "Test Template Info-Icon - Version (2).svg Template documentation" heading will be followed by links such as [view], [edit], [history] and [purge].

You can spot it on these pages by looking for an occurrence of  between  tags.
 * A few template pages have retained that information on the template's main page.

Different wikis may present all this differently. Rarely, main template pages may still contain documentation even when you've checked all of the foregoing; itt a szerkesztő a „ ” és a „ ” közt hozzáad egy egyéni /doc lapcímet, valamint további tartalmat a „ ” után.

You can also look for a notice at the bottom of the page similar to this: "The above documentation is transcluded from Template:Templatename/doc".



Sablonok dokumentációs allap nélkül
If a template doesn't have a documentation subpage, create it and move the template's documentation there (or a placeholder for it). Then you can add template data to the documentation subpage.

Creating the subpage and moving the documentation
To create the documentation subpage, click ""/"" on the main template page; look for the tags and their contents (usually at the bottom).

Nagyjából így kell kinéznie:

Észreveheted, hogy már tartalmazza a TemplateDatát. Ha így van, nagyjából így fog kinézni:

Válassz ki mindent a „ ” után és a „” előtt, és vágd ki a vágólapra, vagy mentsd el ideiglenes dokumentumban. Töröld a „ ”-t, ezzel csak a következőket hagyva:

Mentsd el a sablonlapot.

Hogy létrehozd az új allapot, a böngésződ címsorában szereplő URL végére írd be, hogy „/doc”. Nyomd meg az Enter billentyűt, majd válaszd az új lap létrehozását.

Ha a wikin van {{}} jelzősablon, írd be az új lap tetejére. You may also wish to add other templates, such as a {{}} or {{}} link (if supported by the wiki in question). További információkért lásd: m:Segítség:Sablondokumentáció.

Insert the text you cut or saved in the previous text (beneath the notice template, if applicable).

Wrap any categories in tags so that they apply only to the template's main page:

Számos wikin van  sablon. Use this template here if it's likely that the template you're editing exists in a sandbox version (located at "Template:Templatename/sandbox") in order to prevent the categories from applying to the sandbox page:

Végül tedd közzé a lapot.

You can now add and edit the template data on the documentation subpage using the instructions described in #Methods.

Adding and editing template data on the main template page
If you can't create the /doc page, you can add and edit template data on the template's main page by following the instructions in #Methods.

If a template has a documentation subpage, check both the main page and the documentation subpage for the presence of template data (the tag followed by an array inside curly brackets:  ).

Alternatively, the TemplateData extension can perform this check for you. Kattints a „” vagy „” gombra bármelyik lapon. If the template already has template data on either page, you will see a yellow notice at the top of the page saying either:



vagy

Ha a sablon dokumentációs allapján van TemplateData

If the template has template data on its documentation subpage, this is the page you should edit. You can do this by clicking the "[edit]" located after the heading " Template documentation" (or similar), or, if you are already on the /doc page, by clicking "" or "" at the top. Follow the guidance at #Methods to add or edit the template data.

Ha a sablon főlapján van a TemplateData

If the template has template data on its main page, you once again have two options:


 * Áthelyezheted a dokumentációs allapjára. Ez a javasolt opció.


 * Vagy szerkesztheted a fő sablon lapján.

A TemplateData dokumentációs allapjára való áthelyezése

To do this, click ""/"" on the main template page, and look for the tags, enclosed within  tags. Nagyjából így kell kinéznie:

Cut only the tags and their contents out of the code, then save the page.

Next, edit the documentation subpage by clicking the "[edit]" located after the heading " Template documentation" (or similar).

Type a heading, like "Template data", then beneath it paste the template data.

You can now edit the template data based on the guidance at #Methods.

A sablon főlapján lévő TemplateData szerkesztése

Ha nem szeretnéd a TemplateDatát átmozgatni a /doc lapra, szerkesztheted a sablon főlapján. Lásd a Módszereket arról, hogy hogy szerkeszthető a TemplateData.

Ha a sablonon nincs TemplateData, de van dokumentációs allap

Ha a sablonon nincs TemplateData, a dokumentációs allaphoz kell hozzáadni.

Do this by clicking the "[edit]" located after the heading " Template documentation" (or similar), or, if you are already on the /doc page, by clicking "" or "" at the top. Írj be egy címet, például „TemplateData”, majd add hozzá a cím után. A #Módszerek szakasz tartalmazza, hogy lehet TemplateDatát hozzáadni.

Módszerek


TemplateData-szerkesztővel
Ez egy egyszerű, a kevésbé tapasztalt szerkesztőknek ajánlott módja a TemplateData hozzáadásának vagy szerkesztésének.

The template data editor is a graphical user interface for adding and editing template data. It is part of the TemplateData extension, available on any template's page (or documentation subpage) by clicking "" or "".

After clicking "" or "", you will see a button above the editing area and page title that says "".

|453px

Clicking this button will take you to the template data editor. If the page you are on already contains template data, it will automatically appear here.

600px| The template data editing tool, on a page with no template data.

A fenti ablak funkciói:

If no language template data exists, the interface will only offer users the wiki's own language, but users can click "" to add more inputs. The language code is displayed in brackets next to the parameters to which it can be applied, such as descriptions and labels.
 * The top item chooses the language of the interface text. It allows you to enter text content in multiple languages, displayed to users based on their settings in Preferences, not based on the wiki's language; different wikis have entirely different template databases.
 * The next item is the template description. This is the description of the template as a whole; it's shown to users in numerous places in the template editors while adding a template. This parameter and its effects are documented below.
 * The third item controls the wikitext formatting of the template. This parameter determines how the wikitext will be laid out when the user clicks "", the two main types being  (on one line) and   (on new lines). This parameter and its effects are documented below.
 * If the user chooses "", they can enter wikitext under "" according to Custom formats rules documented below, in order to create a custom layout for the template when the user clicks "".


 * A negyedik elem a sablon paramétereit határozza meg. Ha a paraméterek már definiálva vannak a sablonadatokban, ez a terület listaként jeleníti meg. If the template's source code specifies parameters for which no template data exists, you may see a button labeled "". The editor extracts these suggestions from the template's source code by looking for  or  . Clicking "" will add these parameters using their names as defined in the source code. A green notice will also appear at the top, for example, "".
 * At the bottom of the window you see an "" button. This allows you to add a parameter manually with a custom name.

Continue to the next step by clicking any one of the parameters in the list. This will allow you to edit that parameter's info.

600px

All of these features and their effects are outlined in the section #Within a parameter's name.

Ha végeztél, kattints a „” gombra. This will automatically insert the template data at the bottom of the page before the tag; or, if already present, it will be updated with the new information without changing its position. The template data text will also be selected when you click "".

The template data editor creates a  parameter at the bottom of the template data (or updates it if it already exists). contains the current template data parameters in the order in which they were displayed by the template data editor. You can change the  by dragging the parameters up and down in the template data editor using the three horizontal bars on the left. and its effects are documented below.

After this, click "" to save your revision of the page.



Kézi módszer
You can also add or edit template data manually. Template data is written in JSON, but you do not need to learn JSON to learn how to create template data. Template data follows a few very simple rules and accepts only a few dozen possible predefined parameters and values, typically following a  format.

TemplateData hozzáadása kézzel

Szempontok:


 * If you're adding template data on a template's documentation subpage (recommended), you may add it anywhere on the page; check to see if your language's Wikipedia has a preferred location for it. For example, on the English Wikipedia, template data is typically near the bottom of the documentation page; on the German Wikipedia, it is typically at the top.
 * If you're adding template data on a template's main page (not recommended; see #Prior checks), you must make sure to place it inside the  tags.

Click "" or "" on the respective page, then move to the place in the page where you intend to add template data and write a heading: "Template data".

Számos wikin van TemplateData header sablon, ami a TemplateDatával kapcsolatos rövid információt írja ki. Ha a wikiden van, add hozzá a fejléc után.

To start adding template data, type an opening and closing tag and a pair of curly brackets on new lines, with an empty line between them:

Next, add an indent on the empty line between the two curly brackets, and start adding parameters. Details for the parameters can be found at #Template data parameters. Most are optional; some are highly recommended.

Parameters can be in any order, but what follows is the order that best conforms to template data documentation and makes the content easiest to use for editors:

Make sure the parameters, for example, in the  object, remain inside that object; otherwise you will trigger an "" error when you try to save.

Példa

Itt vannak példaként egy átdolgozást jelző sablon sablonadatai. Such a template would display a notice and place the page into a dated category based on the month and year entered. The notice might also contain a link to a talk page section. The template data would look something like this:

The corresponding template data documentation would display as follows:

{	"description": "A sablont egy szócikk átdolgozásának szükségességének jelzésére használd.", "format": "inline", "params": { "dátum": { "label": "Hónap és év", "description": "A sablon hozzáadásának hónapja és éve", "type": "string", "autovalue": " ", "example": "2013. január", "suggested": true },		"indoklás": { "aliases": ["1"], "label": "Indoklás", "description": "Miért kell átdolgozni a szócikket", "type": "string" },		"vita": { "aliases": ["vitaszakasz"], "label": "A vitalap szakasza", "description": "A vitalap kapcsolódó megbeszélést tartalmazó szakasza", "type": "string" }	},	"paramOrder": [ "dátum", "indoklás", "vita" ] }



TemplateData-paraméterek
A TemplateData összes elérhető paramétere listázva van alább egy leírással és példával. They are also listed in more technical detail at Extension:TemplateData#Format.



A params on belül


Egy paraméternéven belül
Note: if neither,   nor   are set as   for a parameter, its status will show as   in the template data documentation.

Once you're done, hit "". If you've made errors, it will not let you save (which is disruptive but means you can't break anything). Should you run into errors, explain on the feedback page what you were trying to do, and we will be happy to help.

Note that if you are abusing a hack template to dynamically generate template data, it cannot be checked for errors before saving.

Note that each item of information is enclosed in quotation marks (except for  and  ) and separated from the next item by a comma (unless it's the last one).



Típusparaméter
The  parameter is meant to signal to a template editor the nature of a parameter's value. In some cases, template editors have been programmed to modify the user interface for a certain parameter according to this template data value, such as to only allow the user to enter valid values that match the specified type. This parameter does not have any functional effect on the template parameter or its value; it merely controls how template editors see and treat the parameter in editing mode.

Hogyan használd

It is used by adding the  parameter, followed by a colon and a space, then adding any of the values listed in the table below in quotation marks.

Példa:

Hatása

As of February 2020, only 5 of the 13 type values have visible effects in VisualEditor and the 2017 wikitext editor, while 8 have visible effects in TemplateWizard.

The effects of certain values are likely to change as the template editors get updates to support them. One such effort for VisualEditor and the 2017 wikitext editor is tracked in the Phabricator task T55613. A similar effort to get TemplateWizard to support the boolean value is tracked in T200664.

A jelenleg ismert hatások a következők.

Egyedi formátumok
When editing the  value, you create custom formats by inputting a set of wikitext symbols using some predefined rules.


 * - sablon kezdete
 * - tartalom (pl. karakterlánc, egész vagy paraméter). Ez az aláhúzás egy érték minimális karakterszámát jelöli, és ismételhető, például . Ha e hossz nincs elérve, a maradék karaktereket szóközökkel tölti fel. This can be used to align all equals signs to a specific position after a parameter (if used with   for new lines).
 * - pipe (separates parameters)
 * - equals sign (precedes the value of a parameter)
 * or pressing the enter key - new line (this will display as  in the entry field)
 * - space (can be used with  to indent new lines)
 * - sablon vége

The wikitext should at least meet the minimum of, otherwise there will be an invalid format string error.



Üres másolható minta
You can copy the blank boilerplate below to add new template data to a template. Only the most common tags are included.

Hibák


/ Hibás JSON-formátum
These errors occur when saving template data, usually manually edited, with invalid JSON code (duplicate keys/parameters, trailing or missing commas, etc.) in the visual editor or the 2017 wikitext editor.

"" appears in the visual editor and the 2017 wikitext editor; "Bad JSON format" appears when editing in the template data GUI editor.

Ezeket a hibákat nem mindig könnyű észlelni, és túl sok formában jönnek, hogy felsorolhassuk. The best way to avoid them is to edit template data exclusively with the template data editor; the best way to detect them once they've occurred is to use an external JSON validator, such as JSONLint, which will highlight errors and aid in fixing them.

The 2010 wikitext editor does not check for invalid JSON thanks to an old, unfixed bug. Pages that contain invalid JSON may throw alarming "" messages. To fix these errors, your best bet is to use a JSON validator (see above).

Ez a hiba akkor következik be, ha egy -ben lévő paramétert használsz, ami  -ben nincs. The number in the square brackets refers to the parameter in  that is missing. It refers to its order in the sequence, but it is one less than its actual position, since  is an array; 0 is the first one, 1 is the second, etc.

To fix this, make sure all parameters stated in  are listed in. Alternatively, you can remove the  object to remove this error.

This error occurs if you state a parameter in  that is not stated in. The number in the square brackets refers to the parameter in  that shouldn't be there. It refers to its order in the sequence, but it is one less than its actual position, since  is an array; 0 is the first one, 1 is the second, etc.

To fix this, make sure all parameters stated in  are listed in. Alternatively, you can remove the  object to remove this error.

This error occurs if you put quotation marks around the value of either  or.

These are boolean values, not strings, therefore they require no quotation marks. To fix this, remove any quotation marks around the values  or   for these parameters.



A(z) „format” tulajdonság várt értéke…
If the  parameter exists but its value is not ,   or a valid format string, you will see the error message "".

To fix this, make sure the value after  equals   or   and that there no spelling mistakes. Alternatively, if it's wikitext, make sure it contains a minimum of  and that there are no mistakes in the syntax that would normally cause a template to fail, such as duplicate equals signs or missing/duplicate curly brackets; see the section #Custom formats for the syntax for custom formats. Alternatively, you can remove the  parameter to remove this error.

This error occurs if you state a parameter that is unknown in template data. Ezt valószínűleg helyesírási hibák vagy a kis- és nagybetűk keverése okozzák.

It also occurs if you state a parameter in any template data object that is not a parameter of that object. This may be due to spelling mistakes, or you may have written the parameter of one template data object under another object that it doesn't belong to.

For example, you might have written the parameter  under the root template data object instead of inside  :

Alternatively, if the unexpected parameter is under a template parameter inside, you'll see its name after "params.parametername." in the error.

To fix this, make sure there aren't any spelling mistakes in the parameter names, and make sure your parameters are in their correct location. Additionally, make sure you don't state any parameters that don't exist for a template data object. You can check which parameters exist for an object in the section #Template data parameters.

Ez a hiba akkor következik be, ha nincs a TemplateDatában  objektum. This is a necessary object, as it contains all the details of each parameter, so to fix this error, make sure it's added and that there are no spelling mistakes. Lásd a fenti szakaszt arról, hogy hogyan adható hozzá a  paraméter.



Korlátok és visszajelzés

 * Hiányzó funkciók – Template data is an example of a tool that was made available with few features, in hope that users would help to guide development of features that they desired. If you'd like to request new features for template data, please let us know.
 *  Delays in showing in templates  – After adding template data to a template, the metadata should be visible immediately when the template is opened in the visual editor. However, it is possible that it will take several hours before the metadata will show. You can force an update by making a null edit to the template page itself (not the documentation subpage). To perform a null edit, open the template page for editing, and save the page without making any change and without adding any edit summary.
 * Jelenlegi hibák – A jelenlegi hibák és funkciójavaslatok listája elérhető a Wikimédia hibakövetőjében.

<span id="Other_tools">

Egyéb eszközök

 * : A toolbar dialog window for entering template wikitext via an form built from template data.
 * TemplateData Wizard: Egy interaktív felületen keresztül sablonadatokat generáló eszköz.
 * Skeleton TemplateData generator: A tool that reads the source wikicode of a template, tries to find all the parameters used and outputs a skeleton document with the parameters listed.
 * JSONLint: A tool that allows you to validate manually-written JSON to help find errors in the syntax.
 * [ Minden TemplateDatát használó sablon listája] ezen a wikin
 * With dewiki template template data: template data is shown in a box, and the template is added to a category of templates with template data
 * https://query.wikidata.org/ and Query Helper