Usuari:Anskarbot/Traduccions/Help:Template

De la Viquipèdia, l'enciclopèdia lliure

{{Notes de traducció}}

Plantilla:Wiki markup

Dreceres:
H:T
WP:TEMPLATE
To find lists of commonly used templates, see Viquipèdia:Template messages.{#unknown{^*Wiki *markup{#Nom|*H:*T|*WP:PLANTILLA}}
per trobar llistes de plantilles utilitzades generalment, veu *Wikipedia:missatges de Plantilla.A template is a Wikipedia page created to be included in other pages. Templates usually contain repetitive material that might need to show up on any number of articles or pages. They are commonly used for boilerplate messages, standard warnings or notices, infoboxes, navigational boxes and similar purposes.Un plantilla és un *Wikipedia la pàgina creada per ser inclòs en altres pàgines. Les Plantilles normalment contenen material repetitiu que podria necessitar aparèixer en qualsevol número d'articles o pàgines. Són generalment utilitzat per \*boilerplate missatges, avisos o avisos estàndards, *infoboxes, *navigational caixes i propòsits similars.The most common method of inclusion is called transclusion, where the wikitext of the target page contains a reference to the template, using the {{Template name}} syntax. Another method is substitution, where the content of the template is copied into the wikitext of the target page, just once, when it is saved.El mètode més comú d'inclusió és cridat *transclusion, on el \*wikitext de la pàgina d'objectiu conté una referència a la plantilla, utilitzant el <codi><*nowiki{#nom_de_nom de Plantilla}}</*nowiki></codi> *syntax. Un altre mètode és de Substitució, on el contingut de la plantilla és copiat al *wikitext de la pàgina d'objectiu, només una vegada, quan és salvat.For a brief introduction to the subject, see A quick guide to templates.Per una introducció breu al tema, veu Una guia ràpida a plantilles.==General==

Most templates are pages in the Template namespace, which means that they have titles in the form "Template:XXX". It is possible, however, to transclude and substitute from any namespace,[1] and so some template pages are placed in other namespaces, such as the User namespace. Template pages have associated talk pages.==General== La majoria de plantilles són pàgines en el \Plantilla *namespace, el qual significa que tenen títols en la Plantilla "de forma:*XXX". És possible, tanmateix, a *transclude i substitut de qualsevol *namespace,<*ref>*Namespaces de quin *transclusion no és permès és especificat en un *wiki per la variable *wgNonincludableNamespaces</*ref> i així que algunes pàgines de plantilla són col·locades en altre *namespaces, com el \Usuari *namespace. Pàgines de plantilla han associat de pàgina de xerrada.Templates can contain any desired wikitext, including calls to other templates. They have some limited programming capacities: customizable values (called parameters), calculation and branchings (using parser functions), and access to wiki-specific variables (magic words), such as dates, times, and page names. They may also contain tags which define which parts of the wikitext are to be included when the template is transcluded or substituted. This means that the appearance of the template page itself need not be the same as that of the transcluded content (for example, it can contain documentation, categories, etc. for the template).Les Plantilles poden contenir qualsevol desitjat *wikitext, incloent trucades a altres plantilles. Una mica han limitat capacitats de programació: *customizable valors (cridat de Paràmetres), càlcul i *branchings (utilitzant *parser funcions), i accés a *wiki-variables específiques (paraules màgiques), com dates, temps, i noms de pàgina. També poden contenir *tags que defineixen quines parts del *wikitext és per ser inclòs quan la plantilla és *transcluded o va substituir. Això significa que l'aspecte de la pàgina de plantilla ell necessita no ser el mateix que allò del *transcluded contingut (per exemple, pot contenir documentació, categories, *etc. Per la plantilla).How to do it: To transclude a template to an article or page, type {{template name}} in the wikitext at the place where the template is to appear. The prefix "Template:" need not be included, and an initial capital is not necessary.Com per fer-lo: A *transclude una plantilla a un article o pàgina, codi <de tipus><*nowiki{#nom_de_nom de plantilla}}</*nowiki></codi> en el *wikitext al lloc on la plantilla és per aparèixer. La Plantilla "de prefix:" necessita no ser inclòs, i una capital inicial no és necessària.Templates stored in other namespaces are transcluded in the same way, except that the namespace prefix, such as "User:", must be included. To transclude a page in mainspace, precede its title with a colon, as, for example, {{:Page name}}.Les Plantilles van emmagatzemar en altre *namespaces és *transcluded de la mateixa manera, exceptua que el *namespace prefix, com "Usuari:", ha de ser inclòs. A *transclude una pàgina en *mainspace, precedir el seu títol amb un còlon, mentre, per exemple, <codi><*nowiki{#puntnom de Pàgina}}</*nowiki></codi>.Note: Attempting to transclude a template that does not exist produces a red link, just like linking to any other nonexistent page. Following the link allows one to create that particular template. It is not possible to transclude pages between projects (such as different language Wikipedias) – to use a template on another language project, a copy of the template must be created in that project.Nota: Intentant a *transclude una plantilla que no existeix productes un enllaç vermell, només com enllaçar a qualsevol altre *nonexistent pàgina. Seguint l'enllaç permet un per crear que plantilla particular. No és possible a *transclude pàgines entre projectes (com llengua diferent *Wikipedias)&*nbsp;– per utilitzar una plantilla en un altre projecte de llengua, una còpia de la plantilla ha de ser creada en aquell projecte.==Usage syntax==

Parameters[modifica]

The basic transclusion syntax given above can be extended by the addition of parameters, which are used to control the template's output. The syntax for this is

  • {{template name|parameter|parameter|...}}

where each "parameter" may either contain just a value (these are called unnamed parameters) or be of the form name=value (named parameters). The first, second, etc. unnamed parameters are equivalent to parameters named "1", "2", etc.==Ús *syntax==

Paràmetres[modifica]

El bàsic *transclusion *syntax donat damunt pot ser estès per l'addició de \paràmetre*s, els quals són utilitzats per controlar la sortida de la plantilla. El *syntax per això és

  • <codi><*nowiki{#nom_nom_nom_nom de paràmetre|de nom|de plantilla|...}}</*nowiki></Codi>

on cada "paràmetre" tampoc pot contenir només un valor (aquests són cridats *unnamed paràmetres ') o ser del valor <de nom>de codi=de forma</codi> (paràmetres anomenats '). El primer, segon, *etc. *unnamed Els Paràmetres són equivalents als paràmetres van anomenar "1", "2", *etc.Whitespace characters (spaces, tabs, returns) are stripped from the beginnings and ends of named parameter names and values, but not from the middle: thus {{ ... | myparam = this is a test }} has the same effect as {{ ... |myparam=this is a test}}. This does not apply to unnamed parameters, where the whitespace characters are preserved.*Whitespace Caràcters (espais, tabuladors, retorns) és despullat dels començaments i finals de anomenat noms de paràmetre i valors, però no del mig: per això <codi><*nowiki{ #punt.. | *myparam = Això és una prova }}</*nowiki></el codi> té el mateix efecte com <codi><*nowiki{ #punt.. |*myparam=Això és una prova}}</*nowiki></codi>. Això no aplica a *unnamed paràmetres, on el *whitespace els caràcters són conservats.What parameters (if any) can or should be passed to a template, and how they are to be named, depends on the coding of that template. Named parameters can be defined in any order. Superfluous or misnamed parameters will be ignored; undefined parameters will be assigned default values. If a parameter is defined more than once, the last value takes effect.Quins paràmetres (si qualsevol) pot o hauria de ser passat a una plantilla, i com són per ser anomenat, depèn en la codificació d'aquella plantilla. Els Paràmetres anomenats poden ser definits en qualsevol ordre. *Superfluous O *misnamed els paràmetres seran ignorats; *undefined els paràmetres seran assignats *default valors. Si un paràmetre és definit més d'una vegada, l'últim valor agafa efecte.The value of a parameter can be the empty string (pipe or equals sign followed immediately by the next pipe or the closing braces). This is different from leaving the parameter undefined (although templates are often coded so as to behave the same in both cases).El valor d'un paràmetre pot ser la corda buida (tub o signe d'iguals van seguir immediatament pel tub pròxim o el tancament *braces). Això és diferent de deixar el paràmetre *undefined (tot i que les plantilles són sovint *coded a fi de comportar-se igual en ambdós casos).===Substitution=== If a template is to be substituted in the wikitext rather than transcluded, add the modifier subst: after the initial pair of braces, as in {{subst:afd}}. Parameters can be added as normally.

  • Note: if substituting a page from mainspace, the word "subst" must be followed by two colons.===Substitució===

Si una plantilla és per ser substituïda en el *wikitext més que *transcluded, afegir el codi <de modificador>*subst:</codi> després del parell inicial de *braces, mentre en <codi><*nowiki{#unknown{^*subst:*afd}}</*nowiki></codi>. Els Paràmetres poden ser afegits tan normalment.

  • Nota: si substituint una pàgina de *mainspace, la paraula "*subst" ha de ser seguit per dos còlons.===Other details===

Template names are exactly like other page names: case-sensitive except for the first letter, with spaces indistinguishable from underscores. If the symbol # (normally used to link to a section of a page) appears in a transclusion, then it and any characters that follow it are ignored. If the a redirect is transcluded, the redirect's target will be transcluded instead. See #Aliases for more.===Altres noms=== de Plantilla dels detalls són exactament com altre de nom de Pàgina: cas-sensible excepte la primera carta, amb espais *indistinguishable de *underscores. Si el símbol # (normalment utilitzat per enllaçar a una secció d'una pàgina) apareix en un *transclusion, llavors l'i qualssevol caràcters que el segueixen és ignorat. Si l'un redirigir és *transcluded, el redirigir és l'objectiu serà *transcluded en comptes d'això. Veure #*Aliases per més.Notice that the same double-brace syntax is used for many MediaWiki variables and parser functions (see Ajuda:Magic words). For example, the code {{NAMESPACE}} may look like a template call, but it is actually a variable whose value is the namespace prefix of the current page.Avís que el mateix doble-*brace *syntax és utilitzat per molts *MediaWiki variables i *parser funcions (veu Ajuda:paraules Màgiques). Per exemple, el codi <de codi><*nowiki{#unknown{^*NAMESPACE}}</*nowiki></el codi> pot semblar una trucada de plantilla, però és de fet una variable el valor de la qual és el *namespace prefix de la pàgina actual.==Basic template usage examples== (If you wish to experiment with any of these, please use the template sandbox.)==Exemples d'ús de plantilla bàsics== (Si desitges a experiment amb qualsevol d'aquests, si us plau utilitzar el \plantilla *sandbox.)An example of a very simple template can be found at Plantilla:Lambda, which places the lambda symbol, λ. Click the "Edit" tab on that template page to see the template code (its wikitext). The "active" part of that code, called the expansion of the template, is &lambda;. (The remainder of the wikitext is enclosed between <noinclude>...</noinclude> tags, which means that it is displayed on the template page itself, but will not be included along with the template.)Un exemple d'una plantilla molt senzilla pot ser trobat a \Plantilla:Lambda, el qual col·loca el símbol de lambda, λ. Clic el "Editar" tabulador en aquella pàgina de plantilla per veure el codi de plantilla (el seu *wikitext). La "part" activa d'aquell codi, va cridar el expansió de la plantilla, és <codi>&*amp;lambda;</codi>. (El *remainder del *wikitext és tancat entre <*nowiki><*noinclude>...</*noinclude></*nowiki> *tags, El qual significa que és mostrat en la pàgina de plantilla ell, però no serà inclòs juntament amb la plantilla.)To transclude the above template onto another page (e.g. in the Viquipèdia:Sandbox), type {{lambda}} (or {{Lambda}} – the case of the first letter is not significant) somewhere into the wikitext of the target page, and save it. The page will be displayed as if the template call were replaced by the expansion of the template, i.e. as if the wikitext contained &lambda; at that point. The displayed page will therefore contain the text "λ".A *transclude el damunt plantilla a una altra pàgina (*e.*g. En el \*Wikipedia:*Sandbox), codi <de tipus><*nowiki{#nom}}</*nowiki></codi> (o <codi><*nowiki{#nom}}</*nowiki></codi>&*nbsp;– el cas de la primera carta no és significativa) en algun lloc al *wikitext de la pàgina d'objectiu, i salvar-lo. La pàgina serà mostrada com si la trucada de plantilla va ser reemplaçada per l'expansió de la plantilla, *i.*e. Com si el *wikitext va contenir <codi>&*amp;lambda;</codi> a aquell punt. La pàgina mostrada per això contindrà el text "λ".For example, type "The 11th letter of the Greek alphabet is the lambda ({{lambda}})" and you will see "The 11th letter of the Greek alphabet is the lambda (Plantilla:Lambda)". You can use templates without knowing the details of their code – you only need to remember what result they produce (this is usually described on the template page).Per exemple, codi "<de tipus>La 11a carta de l'alfabet grec és la lambda (<*nowiki{#nom}}</*nowiki>)</el codi>" i tu veuran "La 11a carta de l'alfabet grec és la lambda ({#nom}})". Pots utilitzar plantilles sense saber els detalls del seu codi&*nbsp;– tu només necessitat de recordar el que resulta produeixen (això és normalment descrit en la pàgina de plantilla).Another way to use this template is to substitute it. If you type "The 11th letter of the Greek alphabet is the lambda ({{subst:lambda}})" and save the page, you will again see ""The 11th letter of the Greek alphabet is the lambda (λ)". However this time, if you look again at the saved wikitext, you will see that the template calls really were replaced by the expansion of the template when you saved the page. The link between the output text and the template is now broken, and the output will not be affected by changes which might be made to the template at some future time (as it would be in the case of transclusion).Una altra manera d'utilitzar aquesta plantilla és a \de Substitució ell. Si escrius "<codi>La 11a carta de l'alfabet grec és la lambda (<*nowiki{#unknown{^*subst:lambda}}</*nowiki>)</codi>" i salvar la pàgina, una altra vegada veuràs ""<codi>La 11a carta de l'alfabet grec és la lambda (λ)</codi>". Tanmateix a aquesta hora, si mires una altra vegada al salvat *wikitext, veuràs que les trucades de plantilla realment van ser reemplaçades per l'expansió de la plantilla quan vas salvar la pàgina. L'enllaç entre el text de sortida i la plantilla és ara trencat, i la sortida no serà afectada per canvis que podrien ser fet a la plantilla a algun temps futur (mentre seria en el cas de *transclusion).=== Examples with parameters======{{#Nom_nom_nom|de Paràmetres}} amb paràmetres===An example of a template that takes parameters is Plantilla:For. Type {{for|the card game|Contract bridge}} in the sandbox to produce the following text:

This usage takes two unnamed parameters, but the same template can also be used with different numbers of parameters to give slightly different results, as explained in the documentation on the template page. For example, {{For||Latins|Latin (disambiguation)}} produces Error: no s'ha proporcionat cap paràmetre de context. Utilitzeu {{altres usos}} per a notes d'encapçalament d'altres usos. (ajuda). Note in particular the usage with an empty parameter – here the consecutive pipes mean that the first parameter passed to the template is the empty string.Un exemple d'una plantilla que agafa els paràmetres és Plantilla:Per\. Codi <de tipus><*nowiki{#pr{^per|el pont de Contracte|de joc de targeta}}</*nowiki></codi> en el *sandbox per produir el text següent:{#pr{^per|el pont de Contracte|de joc de targeta}} Aquest ús agafa dos *unnamed paràmetres, però la mateixa plantilla també pot ser utilitzada amb números diferents de paràmetres per donar lleugerament resultats diferents, mentre explicat en la documentació en la pàgina de plantilla. Per exemple, <codi><*nowiki{#pr{^Per||llatí|de llatins (*disambiguation)}}</*nowiki></productes> de codi{#pr{^Per||llatí|de llatins (*disambiguation)}} Anota en particular l'ús amb un paràmetre buit&*nbsp;– aquí els tubs consecutius signifiquen que el primer paràmetre passat a la plantilla és la corda buida.Other templates, particularly more complex ones, take named parameters (or a mixture of named and unnamed ones). A simple example is Plantilla:Payoff matrix, used to generate a 2-by-2 grid. Type:

{{payoff matrix | UL = 5 | UR = 7 | DL = 2 | DR = 9 | Name = Example usage }}

Plantilla:Payoff matrix to produce the grid you can see on the right.Altres plantilles, particularment més complex uns, agafa paràmetres anomenats (o una mescla d'anomenat i *unnamed uns). Un exemple senzill és Plantilla:*Payoff matriu, va utilitzar per generar un 2-per-2 reixat. Tipus:

<codi><*nowiki{#unknown{^*payoff matriu | *UL = 5 | *UR = 7 | *DL = 2 | DR. = 9 | Exemple = de Nom ús }}</*nowiki></codi{#unknown{^*payoff matriu | *UL = 5 | *UR = 7 | *DL = 2 | DR. = 9 | Exemple = de Nom nom_to_infSee the template page for more possibilities. Notice that the template is used here without defining all its possible parameters – undefined parameters are given default values.Veure la pàgina de plantilla per més possibilitats. Avís que la plantilla és utilitzada aquí sense definir tots els seus paràmetres possibles&*nbsp;– *undefined els paràmetres són donats *default valors.The spaces around the equal signs and before and after the parameters are used only for clarity – they are not needed, and are ignored when the template is evaluated (although this is not the case with unnamed parameters). However parameter names are fully case sensitive – for example, it is not possible to replace "DR" by "dr" or "Dr" in the above example. Parameters with names that are not used by the template are simply ignored.Els espais al voltant dels signes iguals i abans que i després que els paràmetres són utilitzats només per claredat&*nbsp;– no són necessitats, i és ignorat quan la plantilla és avaluada (tot i que això no és el cas amb *unnamed paràmetres). Tanmateix noms de paràmetre són plenament cas sensible&*nbsp;– per exemple, no és possible de reemplaçar "DR." per "*dr" o "Dr." en el damunt exemple. Paràmetres amb noms que no són utilitzat per la plantilla és senzillament va ignorar.==Usage hints and workarounds==

The following points may be worth noting when using templates:

  • An unnamed parameter cannot contain an ordinary equals sign, as this would be interpreted as setting off a named parameter. (This does not apply if the equals sign comes within another template call or other item which the parser handles separately.) To pass an equals sign in an unnamed parameter (for example in a URL with key/value pairs), replace the equals sign with the special template {{=}}, which returns an equals sign that will not be specially interpreted. Another method is to replace the unnamed parameter (and any subsequent unnamed parameters) with named parameters – the first unnamed parameter is equivalent to a named parameter with the name "1", and so on. So to call template {{done}} with the parameter "a=b", type either {{done|a{{=}}b}} or {{done|1=a=b}}.
  • Similarly, it is not possible to use an ordinary pipe character | in template parameters, as it will be interpreted as a separator. (Again, this does not apply if it comes within another separately parsed item, such as a piped wikilink.) This time the problem can be solved by using the special template {{!}} in place of the pipe, or (if the pipe is not intended to be parsed specially at a higher level) using the HTML entity &#124;.
  • Remember that whitespace characters (spaces, tabs, carriage returns and line feeds) are not automatically stripped from the start and end of unnamed parameters (as they are from named parameters). Including such characters (or any other non-visible characters in any parameters) may in some cases affect the template's behaviour in unexpected ways. (Template designers can use {{StripWhitespace}} to remove unwanted whitespace in unnamed parameters.)
  • In documentation and discussions it is often convenient to be able to produce the template call syntax, with a link to the template in question, but without actually calling the template. This can be done easily using the "{{tl}}" template (the template link template). For example, using the text "{{tl|tc}}" produces "{{tc}}". There is an extended version, {{tlx}}, which also supports parameters.
  • When a template is changed (when the template or one of its subtemplates is edited), the change will be reflected on all pages on which the template is transcluded. However the change may not become visible on all pages immediately – a previously cached version of a page, based on the previous version of the template, may continue to be displayed for some time. Use the purge function to force a page to be displayed using the latest versions of templates. (This includes the template page itself, if it contains usage examples.)
  • When viewing old versions of pages, remember that templates will be transcluded as they are now, not necessarily as they were when the old page version was active.
  • To list all pages onto which a template is transcluded, use What links here on the template page. (This will not include pages where the template has been substituted.)
  • To get a list of templates transcluded on a page, click "Edit", and find the list below the edit window. This list also includes the sub-templates used by the templates that are directly transcluded. To get such a list for a page section, an old version of the page, or your newly edited version prior to saving, click "Show preview" on the appropriate edit page. (For an old version, the subtemplate tree will be constructed according to the templates' current state.)
  • There are limits to the number and complexity of the templates that an article may have. See the "Expand limits" section for help in resolving this.
  • If you'd like the template to leave a time stamp or signature you can write <noinclude><nowiki></noinclude>~~~~~<noinclude></nowiki></noinclude>. But this will only work if you substitute the template. If you transclude it, you'll just get ~~~~~.
  • To improve readability, usually programmers like to split the code with newlines and indent it. Unfortunately MediaWiki software does not allow this functionality and in many instances these purpose-built newlines are treated by the software as content. One possible workaround is to add <!-- before each newline character and --> after it.==Pistes d'ús i *workarounds==

Els punts següents poden valer anotar quan utilitzant plantilles:

  • Un *unnamed el paràmetre no pot contenir un signe d'iguals normal, mentre això seria interpretat com posar d'un paràmetre anomenat. (Això no aplica si el signe d'iguals ve dins d'una altra trucada de plantilla o altre element que el *parser mànecs per separat.) Per passar un signe d'iguals en un *unnamed paràmetre (per exemple en un *URL amb parells/de valor de la clau), reemplaçar el signe d'iguals amb la plantilla especial{#unknown{^*tlx|=}}, el qual retorna un signe d'iguals que no serà especialment va interpretar. Un altre mètode és per reemplaçar el *unnamed paràmetre (i qualsevol subsegüent *unnamed paràmetres) amb paràmetres anomenats&*nbsp;– el primer *unnamed el paràmetre és equivalent a un paràmetre anomenat amb el nom "1", etcètera. Així que per cridar plantilla{#unknown{^*tl|fet}} amb el paràmetre "un=*b", tipus qualsevol <codi><*nowiki{#pp{^fer|un=*b}}</*nowiki></codi o codi><*nowiki{#pp{^fer|1=un=*b}}</*nowiki></codi>.
  • Semblantment, no és possible d'utilitzar un caràcter de tub normal | en paràmetres de plantilla, mentre serà interpretat com a *separator. (Una altra vegada, això no aplica si ve dins d'un altre per separat *parsed element, com un canalitzat *wikilink.) A aquesta hora el problema pot ser solucionat per utilitzar la plantilla especial{#unknown{^*tlx|!}} A lloc del tub, o (si el tub no és pretès per ser *parsed especialment a un nivell més alt) utilitzant el \*HTML entitat <*tt>&*amp;#124;</*tt>.
  • Recorda que *whitespace caràcters (espais, tabuladors, retorns de transport i la línia alimenta) no és automàticament despullat des del principi i final de *unnamed paràmetres (mentre són de paràmetres anomenats). Incloent tals caràcters (o qualsevol altres caràcters no visibles en qualssevol paràmetres) poder dins alguns casos afecten el comportament de la plantilla en maneres inesperades. (Dissenyadors de plantilla poden utilitzar{#unknown{^*tl|*StripWhitespace}} per treure *unwanted *whitespace en *unnamed paràmetres.)
  • En documentació i discussions és sovint convenient de ser capaç de produir la trucada de plantilla *syntax, amb un enllaç a la plantilla en qüestió, però sense de fet cridant la plantilla. Això pot ser fet fàcilment utilitzant el{#unknown{^*tl|*tl}}" plantilla (el enllaç de plantilla plantilla). Per exemple, utilitzant el text "<*tt><*nowiki{#unknown{^*tl|*tc}}</*nowiki></*tt>" productes{#unknown{^*tl|*tc}}". Hi ha una versió estesa,{#unknown{^*tl|*tlx}}, el qual també dóna suport paràmetres.
  • Quan una plantilla és canviada (quan la plantilla o un del seu *subtemplates és editat), el canvi serà reflectit en totes les pàgines en el qual la plantilla és *transcluded. Tanmateix el canvi no pot esdevenir visible en totes les pàgines immediatament&*nbsp;– un anteriorment *cached versió d'una pàgina, va basar en la versió anterior de la plantilla, pot continuar ser mostrat per algun temps. Ús el \de Purga funció per forçar una pàgina per ser mostrada utilitzant les versions més tardanes de plantilles. (Això inclou la pàgina de plantilla ell, si conté exemples d'ús.)
  • Quan veient versions velles de pàgines, recorda que les plantilles seran *transcluded mentre són ara, no necessàriament mentre eren quan la versió de pàgina vella era actiu.
  • Per llistar totes les pàgines al qual una plantilla és *transcluded, ús El que enllaça aquí en la pàgina de plantilla. (Això no inclourà pàgines on la plantilla ha estat substituïda.)
  • Per aconseguir una llista de plantilles *transcluded en una pàgina, el clic "Edita", i trobar la llista sota l'editar finestra. Aquesta llista també inclou el *sub-les plantilles van utilitzar per les plantilles que són directament *transcluded. Per aconseguir tal llista per una secció de pàgina, una versió vella de la pàgina, o la vostra versió novament editada prèvia a estalvi, Espectacle "de clic *preview" en l'apropiat edita pàgina. (Per una versió vella, el *subtemplate l'arbre serà construït segons l'estat actual de les plantilles.)
  • Hi ha límits al número i complexitat de les plantilles que un article pot tenir. Veure el "Expandeixen límits" secció per ajuda en resoldre això.
  • Si t'agradaria la plantilla per deixar un segell de temps o signatura pots escriure <codi>&*lt;*noinclude>&*lt;*nowiki>&*lt;/*noinclude><*nowiki></*nowiki>&*lt;*noinclude>&*lt;/*nowiki>&*lt;/*noinclude></codi>. Però això només feina si substitueixes la plantilla. Si tu *transclude el, només aconseguiràs <*nowiki></*nowiki>.
  • Per millorar amenitat, normalment a programadors els agrada partir el codi amb *newlines i *indent el. Malauradament *MediaWiki el programari no permet aquesta funcionalitat i en molts casos aquest propòsit-construït *newlines és tractat pel programari com contingut. Un possible *workaround és per afegir <codi>&*lt;!--</Codi> abans de cada *newline caràcter i codi>--></codi> després d'ell.==Creating and editing templates==

Templates are created and edited in much the same way as any other page: choose an appropriate name, navigate to that page, then click the Edit tab or create a new page as needed. As mentioned above, templates are normally placed in the Template namespace, though templates intended for your own personal use or for experimentation can be created in your own user space. Anything that can be included on a normal page or article can be included on a template, including other templates (called subtemplates). Templates often make use of programming features – parameters, parser functions and other magic words – which allow the transcluded content to vary depending on context. There are also special tags to control which information is transcluded and which is not.==Creant i editant Plantilles== de plantilles són creades i editat en molta la mateixa manera com qualsevol altra pàgina: escollir un nom apropiat, *navigate a aquella pàgina, llavors clic l'Editar tabulador o crear una pàgina nova mentre va necessitar. Mentre va esmentar damunt, les plantilles són normalment col·locat en el \Plantilla *namespace, encara que les plantilles van pretendre pel vostre ús personal propi o per l'experimentació pot ser creada en el vostre propi d'usuari espacial. Qualsevol cosa que pot ser inclòs en una pàgina normal o l'article poden ser inclosos en una plantilla, incloent altres plantilles (cridat ' és*ubtemplates). Plantilles sovint ús de marca de característiques de programació&*nbsp;– paràmetres, *parser funcions i altre paraules màgiques&*nbsp;– quin permetre el *transcluded contingut per variar que depèn en context. hi ha també especial *tags per controlar quina informació és *transcluded i que no és.Before creating a template, do a quick search for existing templates (e.g. by exploring Category:Wikipedia templates) to see if there's already a template that does what you want, or a similar template whose code can be copied and modified (or left in place and expanded). Look for generic templates on which the new template can be based (for example, navbox templates can be easily created by calling the generic Plantilla:Navbox).Abans de crear una plantilla, un ràpid busca existir plantilles (*e.*g. Per explorar Categoria:*Wikipedia plantilles) per veure si allà ha ja una plantilla que el que vols, o una plantilla similar el codi de la qual pot ser copiat i modificat (o va deixar a lloc i expandit). Busca plantilles genèriques en el qual la plantilla nova pot ser basada (per exemple, *navbox les plantilles poden ser fàcilment creat per cridar el genèric Plantilla:*Navbox).There is no hard rule about what name to choose for a template – make it short but reasonably descriptive. If similar templates exist, try to follow a consistent naming pattern. Templates can be renamed without breaking existing transclusions, provided a redirect to the new template name is left behind.hi ha no regla dura sobre el que anomena per escollir per una plantilla&*nbsp;– el fa curt però raonablement *descriptive. Si les plantilles similars existeixen, intenta seguir un compatible anomenant patró. Les Plantilles poden ser rebatejades sense trencar existint *transclusions, va proporcionar un redirigir al nom de plantilla nou queda darrere.Be extremely careful when editing existing templates – changes made can affect a large number of pages, often in ways you might not expect. For this reason many high-use templates are protected against editing except by administrators (other editors can propose changes on the talk page). Some templates offer a sandbox and test cases for experimentation.Ser extremadament prudent quan editant existint plantilles&*nbsp;– els canvis van fer pot afectar un número gran de pàgines, sovint en maneres no podries esperar. Per aquesta raó moltes plantilles d'ús alt són protegida contra editar excepte per \d'administrador (altres editors poden proposar canvis en la pàgina de xerrada). Algunes plantilles ofereixen un *sandbox i de Plantilla casos per experimentació.To propose the deletion of unused or inappropriate templates, or other changes in the way particular templates are used, go to Templates for discussion (TfD).Per proposar el *deletion de *unused o plantilles inadequades, o altres canvis en la manera les plantilles particulars són utilitzades, va a \de discussió per discussió (*TfD).===Handling parameters=== The values of the parameters which can be fed to a template are represented in the template code by items enclosed between triple braces:

  • the code {{{xxx}}} will be replaced by the value of the parameter named xxx
  • the codes {{{1}}}, {{{2}}} etc. will be replaced by the first, second etc. unnamed parameter (or the value of a parameter named 1, 2, etc.); these are sometimes known as positional parameters===Manejant paràmetres===

Els valors dels paràmetres que poden ser alimentat a una plantilla és representada en el codi de plantilla pels elements tancats entre terna *braces:

  • el codi <de codi><*nowiki{{#unknown{^*xxx}}}</*nowiki></el codi> serà reemplaçat pel valor del paràmetre anomenat *xxx
  • el codi <de codis><*nowiki{{#num{^1}}}</*nowiki></codi>, <codi><*nowiki{{#num{^2}}}</*nowiki></codi> *etc. Serà reemplaçat pel primer, segon *etc. *unnamed Paràmetre (o el valor d'un paràmetre anomenat 1, 2, *etc.); Aquests són de vegades sabut mentre posicional paràmetresIf a parameter is not assigned a value, then the above replacements will not take place – the form "{{{xxx}}}" will remain as the effective value of the parameter. To change this behaviour, define default values using the pipe syntax. For example, {{{1|default}}} will be replaced by the first unnamed parameter if there is one, or otherwise by the text "default". Similarly, {{{xxx|}}} will be replaced by the parameter named xxx if it exists, or otherwise will be left blank. Though if a template is called with the parameter specified as empty (e.g. {{Example|}}), the default for the parameter will be ignored; if that is undesired one can use {{#if:{{{1|}}}|{{{1}}}|default}} instead to get the text "default" even if the parameter is specified as empty.Si un paràmetre no és assignat un valor, llavors el damunt les substitucions no tindran lloc&*nbsp;– la forma{{#unknown{^*xxx}}}" quedarà com el valor eficaç del paràmetre. Per canviar aquest comportament, defineix *default els valors que utilitzen el tub *syntax. Per exemple, <codi><*nowiki{{#num{^1|*default}}}</*nowiki></el codi> serà reemplaçat pel primer *unnamed paràmetre si hi ha un, o altrament pel text "*default". Semblantment, <codi><*nowiki{{#unknown{^*xxx|}}}</*nowiki></el codi> serà reemplaçat pel paràmetre anomenat *xxx si existeix, o altrament quedarà espai. Tanmateix si una plantilla és cridada amb el paràmetre va especificar tan buit (*e.*g. <Codi>Exemple: [[]]</codi>), el *default pel paràmetre serà ignorat; si allò és *undesired un pot utilitzar <codi><*nowiki{##cnj:{{#num{^1{{#num{^1}}}|*default}}</*nowiki></codi> en comptes d'això per aconseguir el text "*default" fins i tot si el paràmetre és especificat tan buit.Parameters do not get expanded when they are inside nowiki tags or XML-style extension tags. Thus, the following will not work within a template – <myextension xparam={{{tparam}}}> ... </myextension> – because the parameter is not expanded.Els Paràmetres no aconsegueixen expandits quan són interior *nowiki *tags o *XML-extensió d'estil *tags. Així, el seguint no treballarà dins d'una plantilla&*nbsp;– <*nowiki><*myextension *xparam{{#unknown{^*tparam}}}> ... </*myextension></*nowiki>&*nbsp;– Perquè el paràmetre no és expandit.Because of the multiple uses of double-brace and triple-brace syntax, expressions can sometimes be ambiguous. It may be helpful or necessary to include spaces to resolve such ambiguity, for example by writing {{ {{{xxx}}} }} or {{{ {{xxx}} }}}, rather than typing five consecutive braces. However, watch out for unwanted whitespace appearing in template expansions.A causa dels usos múltiples de doble-*brace i triple-*brace *syntax, les expressions de vegades poden ser ambigües. Pot ser útil o necessari d'incloure espais per resoldre tal ambigüitat, per exemple per escriure <codi><*nowiki{ {{{#unknown{^*xxx}}} }}</*nowiki></codi o codi><*nowiki{{ {{#unknown{^*xxx}} }}}</*nowiki></codi>, més que escriure cinc consecutiu *braces. Tanmateix, rellotge fora de per *unwanted *whitespace apareixent en expansions de plantilla.===System variables and conditional logic======Variables de sistema i lògica condicional===Template code often makes use of the variables and parser functions described at Ajuda:Magic words, in order to make the template's behaviour depend on the environment (such as the current time or namespace) or on the parameter values which are passed to it. They can also be used for arithmetical calculations. Notice that full string manipulation is not available (although templates have been created which provide such functionality, though very inefficiently and imperfectly), nor are certain standard programming features such as loops and variable assignment.Codi de plantilla sovint fa ús de les variables i *parser les funcions van descriure a \Ajuda:paraules Màgiques, per tal de marca el comportament de la plantilla depèn en l'entorn (com el temps actual o *namespace) o en els valors de paràmetre que són passats a ell. També poden ser utilitzats per càlculs aritmètics. Avís que manipulació de corda plena no és disponible (tot i que les plantilles han estat creades que proporcionen tal funcionalitat, tanmateix molt *inefficiently i *imperfectly), ni és característiques de programació estàndards segures com bucles i variable *assignment.Some of the most often used variables and functions are listed hereafter. For more, see Ajuda:Magic words, and the fuller documentation at the MediaWiki pages mw:Help:Magic words and mw:Help:Extension:ParserFunctions.Alguns del més variables utilitzades sovint i les funcions són llistades d'ara endavant. Per més, veu Ajuda:paraules Màgiques, i la documentació més plena al *MediaWiki pàgines *mw:Ajuda:paraules Màgiques i *mw:Ajuda:Extensió:*ParserFunctions.{| class="wikitable" style="text-align:center;" width="80%"

|+Examples of core parser functions ! width="30%" | Description !! width="40%" | Text entered !! width="30%" | Result |- | Uppercasing text |{{uc: Heavens to BETSY! }} |HEAVENS TO BETSY! |- | Lowercasing text |{{lc: Heavens to BETSY! }} |heavens to betsy! |- | Getting a namespace name |{{NS: 1 }} |Discussió |- | Getting a Wikipedia URL |{{fullurl: pagename }} |//ca.wikipedia.org/wiki/Pagename |}| #Nom="*wikitable" text="d'estil-*align:centre;" amplada="80%" |+Exemples de nucli *parser funcions ! Amplada="30%" | Descripció !! Amplada="40%" | Text va entrar a !! Amplada="30%" | Resultat |- | *Uppercasing text |<*nowiki{#unknown{^*uc: Cels a *BETSY! }}</*nowiki{#unknown{^*uc: Cels a *Betsy! }} |- | *Lowercasing Text |<*nowiki{#unknown{^*lc: Cels a *BETSY! }}</*nowiki{#unknown{^*lc: Cels a *BETSY! }} |- | Aconseguint un *namespace nom |<*nowiki{#unknown{^*NS: 1 }}</*nowiki{#unknown{^*NS: 1 }} |- | Aconseguint un *Wikipedia *URL |<*nowiki{#unknown{^*fullurl: *pagename }}</*nowiki{#unknown{^*fullurl: *pagename}} |}The ParserFunctions extension gives more programming-oriented parser functions.El *ParserFunctions l'extensió dóna més programació-*oriented *parser funcions.{| class="wikitable" style="text-align:center;" width="80%" |+Examples of extension parser functions ! width="30%" | Description !! width="40%" | Text Entered !! width="30%" | Result |- | Testing between options |{{#ifeq: yes | yes | Hooray...! | Darn...! }}
{{#ifeq: yes | no | Hooray...! | Darn...! }} |Hooray...!
Darn...! |- | Testing if a parameter is set |{{#if: {{{param|}}} | Hooray...! | Darn...! }} |Darn...! |- | Making a calculation (mathematics)
[area of circle of radius 4, to 3 decimal places] |{{#expr: ( pi * 4 ^ 2 ) round 3 }} |50.265 |- | Testing the result of a calculation
[is 1230 even or odd?] |{{#ifexpr: 1.23E+3 mod 2 | Odd | Even }} |Even |}| #Nom="*wikitable" text="d'estil-*align:centre;" amplada="80%" |+Exemples d'extensió *parser funcions ! Amplada="30%" | Descripció !! Amplada="40%" | Text va Entrar a !! Amplada="30%" | Resultat |- | Testatge entre opcions |<*nowiki{##unknown{^*ifeq: sí | sí | *Hooray...! | *Darn...! }}</*nowiki><*br><*nowiki{##unknown{^*ifeq: Sí | cap | *Hooray...! | *Darn...! }}</*nowiki{##unknown{^*ifeq: Sí | sí | *Hooray...! | *Darn...! }}<*br{##unknown{^*ifeq: Sí | cap | *Hooray...! | *Darn...! }} |- | Testatge si un paràmetre és posat |<*nowiki{##cnj:{{#unknown{^*param|}}} | *Hooray...! | *Darn...! }}</*nowiki{##Cnj:{{#unknown{^*param|}}} | *Hooray...! | *Darn...! }} |- | Fa un càlcul (matemàtiques)<*br />[àrea de cercle de *radius 4, a 3 llocs decimals] |<*nowiki{##unknown{^*expr: ( *pi * 4 ^ 2 ) ronda 3 }}</*nowiki{##unknown{^*expr: ( *pi * 4 ^ 2 ) ronda 3 }} |- | Prova el resultat d'un càlcul<*br />[és 1230 fins i tot o estrany?] |<*nowiki{##unknown{^*ifexpr: 1.23*E+3 *mod 2 | Estrany | Fins i tot }}</*nowiki{##unknown{^*ifexpr: 1.23*E+3 *mod 2 | Estrany | Fins i tot }} |}{| class="wikitable" style="text-align:center;" width="80%" |+Examples of System Variables ! width="30%" | Description !! width="40%" | Text Entered !! width="30%" | Result (for this help page) |- | Page names |{{PAGENAME}}
{{FULLPAGENAME}} |Anskarbot/Traduccions/Help:Template
Usuari:Anskarbot/Traduccions/Help:Template |- | Name of the current namespace |{{NAMESPACE}} |Usuari |- | Number of registered users |{{NUMBEROFUSERS}} |480.307 |- | Number of pages in a given category |{{PAGESINCATEGORY:"Weird Al" Yankovic albums}} |0 |- |Current software version |{{CURRENTVERSION}} |1.43.0-wmf.1 (8e1947e) |- |Timestamp of last revision |{{REVISIONTIMESTAMP}} |20221201201755 |}| #Nom="*wikitable" text="d'estil-*align:centre;" amplada="80%" |+Exemples de Variables de Sistema ! Amplada="30%" | Descripció !! Amplada="40%" | Text va Entrar a !! Amplada="30%" | Resultat (per aquesta pàgina d'ajuda) |- | noms de Pàgina |<*nowiki{#unknown{^*PAGENAME}}</*nowiki><*br><*nowiki{#unknown{^*FULLPAGENAME}}</*nowiki{#unknown{^*PAGENAME}}<*br{#unknown{^*FULLPAGENAME}} |- | Nom del corrent *namespace |<*nowiki{#unknown{^*NAMESPACE}}</*nowiki{#unknown{^*NAMESPACE}} |- | Número d'usuaris registrats |<*nowiki{#unknown{^*NUMBEROFUSERS}}</*nowiki{#unknown{^*NUMBEROFUSERS}} |- | Número de pàgines en una categoria donada |<*nowiki{#unknown{^*PAGESINCATEGORY:"Estrany *Al" *Yankovic àlbums}}</*nowiki{#unknown{^*PAGESINCATEGORY:"Estrany *Al" *Yankovic àlbums}} |- |versió de programari Actual |<*nowiki{#unknown{^*CURRENTVERSION}}</*nowiki{#unknown{^*CURRENTVERSION}} |- |*Timestamp d'última revisió |<*nowiki{#unknown{^*REVISIONTIMESTAMP}}</*nowiki{#unknown{^*REVISIONTIMESTAMP}} |}The PAGENAME and NAMESPACE variables are particularly useful, and frequently used, to change template behavior based on context. For example, if the template transcludes a category link (e.g. cleanup templates, which transclude a link categorizing the page as a page which needs cleanup), it will often check the NAMESPACE variable to make sure that talk pages, user pages, or anywhere else the tag might incidentally be placed do not themselves get categorized as pages needing cleanup.El *PAGENAME i *NAMESPACE les variables són particularment útil, i freqüentment utilitzat, per canviar comportament de plantilla basat en context. Per exemple, si la plantilla *transcludes un enllaç de categoria (*e.*g. *cleanup Plantilles, el qual *transclude un enllaç *categorizing la pàgina com a pàgina que necessita *cleanup), sovint comprovarà el *NAMESPACE variable per fer segur que pàgines de xerrada, pàgines d'usuari, o a qualsevol lloc més el *tag addicionalment podria ser col·locat no ells aconsegueix *categorized tan les pàgines que necessiten *cleanup.===Nesting templates=== Templates may contain other templates – this is usually called "nesting". As the template is processed, the wikitext produced by any nested templates is transcluded into the nesting template, so that the final product is essentially processed from the most deeply nested template out. While fairly straightforward in application, it involves some noteworthy quirks and tricks.===Plantilles de plantilles=== de la imbricació poden contenir altres plantilles&*nbsp;– això és imbricació cridada "normalment". Mentre la plantilla és processada, el *wikitext va produir per qualsevol *nested les plantilles és *transcluded a la plantilla d'imbricació, de manera que el producte final és essencialment processat del més profundament *nested plantilla fora. Mentre força sincer en aplicació, implica algun *noteworthy *quirks i trucs.To pass a parameter value to a nested template, place a parameter tag as the value of one of the nested template's parameters.

  • Examples:
    • Template:A contains "the quick brown {{B|{{{3}}}}} jumps over...". This takes the value passed to the third positional parameter of Template:A and passes it as the first positional parameter of Template:B, then returns the wikitext produced by B as part of the phrase.
    • Template:A contains "the quick brown {{B|waldo={{{3}}}}} jumps over...". As above, except the third positional parameter of Template:A is passed to the named parameter "waldo" of Template:B.Per passar un valor de paràmetre a un *nested plantilla, lloc un paràmetre *tag com el valor d'un del *nested els paràmetres de plantilla.
  • Exemples:
    • Plantilla:Un conté <*nowiki>"el marró ràpid{#unknown{^*B|{{{#num_nom}}}}} per damunt..."</*nowiki>. Això agafa el valor passat al tercer paràmetre posicional de Plantilla:Un i el passa com el primer paràmetre posicional de Plantilla:*B, llavors retorna el *wikitext va produir per *B com part de la frase.
    • Plantilla:Un conté <*nowiki>"el marró ràpid{#unknown{^*B|*waldo={{{#num_nom}}}}} per damunt..."</*nowiki>. Com a dalt, excepte el tercer paràmetre posicional de Plantilla:Un és passat al paràmetre anomenat "*waldo" de Plantilla:*B.Template parameters themselves can be chosen conditionally.
  • Example:
    • Template:A contains "the quick brown {{B|{{{3}}}=fox}} jumps over...". Template:A passes the word "fox" to a parameter of Template:B that's named in A's third positional parameter.Paràmetres de plantilla ells pot ser escollit *conditionally.
  • Exemple:
    • Plantilla:Un conté <*nowiki>"el marró ràpid{#unknown{^*B{{#num{^3}}}=*fox}} salta per damunt..."</*nowiki>. Plantilla:Uns passis la paraula "*fox" a un paràmetre de Plantilla:*B allò és anomenat en Un és tercer paràmetre posicional.A template can call itself, but will stop after one iteration to prevent an infinite loop.Una plantilla es pot cridar, però pararà després d'un *iteration per impedir un bucle infinit.When a nested template contains unmatched braces – as in {{lb}}} – the unmatched braces are treated as text during processing, and do not affect the parsing of braces in the nesting template. If the nested template is substituted, however, the substitution is processed first, and this will change how braces are parsed in the nesting template. This has little practical use, but can occasionally introduce unexpected errors.Quan un *nested la plantilla conté *unmatched *braces&*nbsp;– mentre en{#unknown{^*tl|*lb}}}&*nbsp;– el *unmatched *braces és tractat com text durant processar, i no afecta el *parsing de *braces en la plantilla d'imbricació. Si el *nested la plantilla és substituïda, tanmateix, la substitució és processada primer, i això ' canvi com *braces és *parsed en la plantilla d'imbricació. Això té poc ús pràctic, però ocasionalment pot introduir errors inesperats.See the meta:Help:Advanced templates and meta:Help:Recursive conversion of wikitext for more information. These pages also contain information on unusual calls such as {{template {{{parameter|}}} }}.Veure el \*meta:Ajuda:plantilles Avançades i *meta:Ajuda:*Recursive conversió de *wikitext per més informació. Aquestes pàgines també contenen informació en trucades inusuals com <*nowiki{#nom_de_nom }}</*nowiki>.===Noinclude, includeonly, and onlyinclude===
Dreceres:
WP:NOINCLUDE
WP:INCLUDEONLY
WP:ONLYINCLUDE

By default, when a template is transcluded (or substituted), the entire wikitext (code) of the template page gets included in that of the target page. However it is possible to modify that behaviour, using tags that specify which parts of the template code are to be included. This makes it possible to avoid transcluding information intended for display only on the template page itself, such as the template's documentation, categories and interwiki links. It is also possible to have parts of the code be transcluded, but not be processed on the template page itself (e.g. categories to be applied to the target pages which do not apply to the template). The tags are as follows

  • <noinclude>...</noinclude> – the text between the noinclude tags will not be included when the template is transcluded (substituted)
  • <includeonly>...</includeonly> – the text between the includeonly tags will be transcluded (substituted), but will not be processed on the template's own page
  • <onlyinclude>...</onlyinclude> (not often used) – specifies that nothing on the page except what appears between the onlyinclude tags will be transcluded (substituted)===*Noinclude, *includeonly, i *onlyinclude{#nom|*WP:*NOINCLUDE|*WP:*INCLUDEONLY|*WP:*ONLYINCLUDE}}

Per *default, quan una plantilla és *transcluded (o substituït), el sencer *wikitext (codi) de la pàgina de plantilla aconsegueix inclosa en allò de la pàgina d'objectiu. Tanmateix és possible de modificar aquell comportament, utilitzant *tags que especifica quines parts del codi de plantilla són per ser inclòs. Això el fa possible d'evitar *transcluding la informació pretesa per pantalla només en la pàgina de plantilla ell, com la documentació de la plantilla, de Categoria i *interwiki enllaços. És també possible de tenir parts del codi ser *transcluded, però <*em>no</*em> ser processat en la pàgina de plantilla ell (*e.*g. Categories per ser aplicades a les pàgines d'objectiu que no apliquen a la plantilla). El *tags és de la manera següent{#unknown{^*tag|*noinclude}}&*nbsp;– el text entre el *noinclude *tags no serà inclòs quan la plantilla és *transcluded (substituït){#unknown{^*tag|*includeonly}}&*nbsp;– el text entre el *includeonly *tags serà *transcluded (substituït), però no serà processat en la pàgina pròpia de la plantilla{#unknown{^*tag|*onlyinclude}} (no sovint utilitzat)&*nbsp;– especifica que res en la pàgina <*em>exceptua</*em> el que apareix entre el *onlyinclude *tags serà *transcluded (substituït)Perhaps the most common issue with the use of these blocks is unwanted spaces or lines. It is important to remember that the effect of these tags ends immediately after the last angle bracket, not on the next line or with the next visible character.Potser l'assumpte més comú amb l'ús d'aquests blocs és *unwanted espais o línies. És important de recordar que l'efecte d'aquests *tags finals immediatament després de l'últim angle *bracket, no en la línia pròxima o amb el caràcter visible pròxim.These tags can be nested inside each other, though (for a given page) this really only applies to the <onlyinclude> tag; nesting <includeonly> and <noinclude> tags is fairly pointless. Be careful not to split the tags, however. Constructions like <onlyinclude>abc<includeonly>def</onlyinclude>ghi</includeonly> will not work as expected. Use the "first opened, last closed" rule that is standard for XML.===Problems and workarounds===

  • If the first included character of a template is one of the Wiki markup characters :;*#, then it is processed as though it is at the beginning of a line (even when the template tag is not). This allows the creation of various kinds of lists in templates where the template may not always be in the correct place for a list. To avoid this use <nowiki /> before the markup; see Ajuda:Nowiki.
  • For issues involving the substitution of templates (for example, how to control whether subtemplates are substituted as well when the parent template is substituted), see Ajuda:Substitution.
  • The template {{Strip whitespace}} can be used to strip any initial or final whitespace from unnamed parameter values, if this would cause problems (named parameter values are automatically stripped in this way).
  • For debugging templates the following techniques are sometimes helpful:
    • using "subst:" – substituting a template (rather than transcluding it) can show more clearly what is happening when the template is transcluded; see Ajuda:Substitution.
    • using "msgnw:" – this keyword (short for "message, nowiki") transcludes the wikitext of the template page, more or less, rather than the processed contents. It is not perfect: lists are rendered, comments are removed, and single newlines are replaced with spaces (which is particularly confounding when transcluding wikitext tables).
    • using Especial:ExpandTemplates to see the full recursive expansion of one or more templates.
  • To protect server resources and avoid infinite loops, the parser imposes certain limits on the depth of nesting of transclusions and on the page size with expanded templates. This may cause pages to break when using very complex templates, particularly if there are multiple such templates on the same page. For more information, see Template limits. A page's overall load on the server can be checked by examining the generated HTML for a page and looking for the "NewPP limit report" comments.
  • Do not use = wikimarkup to create section headers within a template which is intended for use in article space – this will create an [edit] link that when transcluded will confusingly open the template for editing.
    • You may avoid [edit] links to the template by including <includeonly>__NOEDITSECTION__</includeonly>===Problemes i *workarounds===
  • Si el primer caràcter inclòs d'una plantilla és un del *Wiki *markup codi <de caràcters>:;*#</codi>, llavors és processat com si és al començament d'una línia (fins i tot quan la plantilla *tag no és). Això permet la creació de diverses classes de llistes en plantilles on la plantilla pot no sempre ser en el lloc correcte per una llista. Per evitar aquest ús{#unknown{^*tag|*nowiki|*s}} abans del *markup; veure Ajuda:*Nowiki.
  • Pels assumptes que impliquen la substitució de plantilles (per exemple, com per controlar si *subtemplates és substituït també quan la plantilla de pare és substituïda), veu Ajuda:Substitució.
  • La plantilla{#unknown{^*tl|Tira *whitespace}} pot ser utilitzat per despullar-se qualsevol inicial o final *whitespace de *unnamed valors de paràmetre, si això causaria problemes (valors de paràmetre anomenat són automàticament despullat d'aquesta manera).
  • Per depurar plantilles les tècniques següents són de vegades útil:
    • utilitzant "*subst:"&*nbsp;– substituint una plantilla (més que *transcluding ell) pot mostrar més clarament el que està passant quan la plantilla és *transcluded; veure Ajuda:Substitució.
    • Utilitzant "*msgnw:"&*nbsp;– aquest *keyword (curt per "missatge, *nowiki") *transcludes el *wikitext de la pàgina de plantilla, més o menys, més que els continguts processats. No és perfeccionar: les llistes són *rendered, els comentaris són trets, i sol *newlines és reemplaçat amb espais (quin és particularment *confounding quan *transcluding *wikitext taules).
    • Utilitzant Especial:*ExpandTemplates per veure el ple *recursive expansió d'un o més plantilles.
  • Per protegir recursos de servidor i evitar bucles infinits, el *parser imposa límits segurs en la profunditat d'imbricació de *transclusions i en la mida de pàgina amb plantilles expandides. Això pot causar pàgines per trencar quan utilitzant plantilles molt complexes, particularment si hi ha múltiple tals plantilles en la mateixa pàgina. Per més informació, veu de límits de Plantilla. La càrrega global d'una pàgina en el servidor pot ser comprovada per examinar el generat *HTML per una pàgina i buscant el "*NewPP comentaris d'informe" del límit.
  • No utilitza <codi>=</de codi> *wikimarkup per crear encapçalaments de secció dins d'una plantilla que és pretesa per ús en espai d'article&*nbsp;– això crearà un <codi>[edita]</enllaç> de codi que quan *transcluded *confusingly obrir la plantilla per editar.
    • Pots evitar <codi>[edita]</enllaços> de codi a la plantilla per incloure <codi><*nowiki><*includeonly>__*NOEDITSECTION__</*includeonly></*nowiki></codi>===Documentation and categories===

Categorizing your template and documenting its proper usage will make it easier for other editors to find and use. For detailed advice, see Viquipèdia:Template documentation.===Documentació i categories===

  • Categorizing la vostra plantilla i documentant el seu ús apropiat el farà més fàcil per altres editors per trobar i ús. Per consell detallat, veu *Wikipedia:documentació de Plantilla.Documentation for users, together with the template's categories and interwiki links, is normally placed after the template code, inside "noinclude" tags. It is normally necessary to put the opening "noinclude" tag immediately after the end of the code, with no intervening spaces or newlines, to avoid transcluding unwanted whitespace.Documentació per usuaris, juntament amb les categories de la plantilla i *interwiki enllaços, és normalment col·locat després del codi de plantilla, interior "*noinclude" *tags. És normalment necessari de posar l'obertura "*noinclude" *tag immediatament després del final del codi, sense espais d'intervenir o *newlines, per evitar *transcluding *unwanted *whitespace.In the case of complex templates, the documentation (together with categories and wikilinks) is often kept on a separate subpage of the template page (named "Template:XXX/doc"). This also applies to many protected templates (to allow the information to be edited by non-administrators). This is achieved by placing the {{Documentation}} template after the main template code (within "noinclude" tags). If the "/doc" subpage does not exist, a link will then appear enabling it to be created.En el cas de plantilles complexes, la documentació (juntament amb categories i *wikilinks) és sovint continuat un separat *subpage de la pàgina de plantilla (Plantilla anomenada:*XXX/*doc"). Això també aplica a molts protegida plantilles (per permetre la informació per ser editada per no-administradors). Això és aconseguit per col·locar el{#unknown{^*tl|nom_de_nomSome templates contain category definitions in their transcluded code, i.e. they are intended to place the target pages in particular categories. This is often done with maintenance categories (placing articles into ordinary content categories in this way is discouraged). When doing this, it may be necessary to use "includeonly" tags to keep the template itself out of the category. The template should also be designed to suppress categorization in the case of demonstration uses – see Category suppression in templates.Algunes plantilles contenen definicions de categoria en el seu *transcluded codi, *i.*e. Són pretesos per col·locar les pàgines d'objectiu en particular categories. Això és sovint fet amb categories de manteniment (articles de col·locació a categories de contingut normal d'aquesta manera és descoratjada). Quan fent això, pot ser necessari d'utilitzar "*includeonly" *tags per mantenir la plantilla ell fora de la categoria. La plantilla també hauria de ser dissenyada per suprimir *categorization en el cas d'usos de manifestació&*nbsp;– veure Categoria *suppression en plantilles.=== Aliases ====== *Aliases ===Aliases can be created with redirects. For example, Plantilla:Tsh redirects to Plantilla:Template shortcut. Then you can write {{tsh|foo}} instead of {{Template shortcut|foo}}.It's good to prepare template aliases which only differ in whitespaces and capitalization. For example there's a template {{See Wiktionary}}. The "W" is capital, since the word "Wiktionary" is so. But a redirect {{See wiktionary}} with lower "w" exists because users are likely to use the latter.És bo de preparar plantilla *aliases que només difereix en *whitespaces i capitalització. Per exemple hi ha una plantilla{#unknown{^*tl|Veu *Wiktionary}}. El "*W" és capital, des de la paraula "*Wiktionary" és tan. Però un redirigir{#unknown{^*tl|Veure *wiktionary}} amb més baix "*w" existeix perquè els usuaris són probablement per utilitzar l'últim.==Template limits==

"Post-expand include size" limit. When templates are rendered or expanded to HTML for viewing in your browser, they use memory. This is called the "post-expand include size" and has a limit of 2,048,000 bytes. This size is included as an invisible comment in the HTML output – use your browser's view source feature to show the raw HTML and search for newpp. The report will look like:

<!--
NewPP limit report
Preprocessor node count: 2382/1000000
Post-expand include size: 63476/2048000 bytes
Template argument size: 9517/2048000 bytes
Expensive parser function count: 2/500
-->

==Àncora de límits==

Plantilla:De la plantilla Plantilla:De límits "Correu-expandir incloure límit" de mida. Quan les plantilles són *rendered o expandit a *HTML per veure en el vostre navegador, utilitzen memòria. Això és cridat el "correu-expandir incloure mida" i té un límit de 2,048,000 bytes. Aquesta mida és inclosa com a comentari invisible en el *HTML sortida&*nbsp;– ús la vista del vostre navegador característica de font per mostrar el cru *HTML i busca *newpp. L'informe semblarà: The example shows that template expansion is using 63k out of 2M of available memory.L'exemple mostra que expansió de plantilla està utilitzant 63*k fora de 2*M de memòria disponible.Display problem. If too many templates are included on a page, the post-expand include size may exceed the limit. When this happens, templates after the limit will no longer expand and will instead display as a wikilink (for example, Template:templatename). Common causes are the inclusion of too many citation templates and/or flag templates. To resolve this problem substitute templates, remove templates, or split the page.Problema de pantalla. Si massa plantilles són incloses en una pàgina, el correu-expandir incloure la mida pot superar el límit. Quan això passa, plantilles després del límit ja no expandirà i en comptes d'això pantalla com a *wikilink (per exemple,{#nom|1=<*u>Plantilla:*templatename</*u>}}). Les Causes comunes són la inclusió de massa *citation plantilles i/o plantilles de bandera. Per resoldre aquest problema de substitut de la Substitució, treure plantilles, o partir la pàgina.==See also====Veu també=={| class="wikitable" !width=25%|Help pages !width=25%|Manual pages !width=25%|Special pages !width=25%|Other pages not for direct viewing |- valign=top |

|

|

|

|}| #Nom="*wikitable" !Amplada=25%|pàgines d'Ajuda !Amplada=25%|pàgines Manuals !Amplada=25%|pàgines Especials !Amplada=25%|Altres pàgines no per visionament directe |- *valign=part superior |

|

|

|

|}==Notes==

  1. Namespaces from which transclusion is not allowed are specified on a wiki by the variable $wgNonincludableNamespaces

Plantilla:Help navigation [[Categoria:Ús de plantilles]] [[lt:Pagalba:Kaip naudotis šablonais]] [[zh:Help:模板]] [[ro:Ajutor:Formate]] [[hsb:Pomoc:Předłohi]] [[no:Hjelp:Maler]] [[ja:Help:テンプレート]] [[nl:Help:Gebruik van sjablonen]] [[pt:Wikipédia:Predefinições]] [[ru:Википедия:Механизм шаблонов]] [[tr:Yardım:Şablon kullanımı]] [[ar:مساعدة:قالب]] [[gl:Wikipedia:Modelos]] [[cs:Nápověda:Šablony]] [[eo:Helpo:Ŝablono]] [[af:Wikipedia:Sjabloon]] [[es:Ayuda:Plantillas]] [[et:Juhend:Mall]] [[ms:Bantuan:Templat]] [[Ajuda:Plantilla]] [[it:Aiuto:Template]] [[fr:Aide:Modèle]] [[simple:Help:Template]] [[mr:सहाय्य:साचा]] [[dsb:Pomoc:Pśedłogi]] [[sr:Помоћ:Шаблон]] [[km:ជំនួយ:ទំព័រគំរូ]] [[ur:معاونت:سانچہ]] [[fa:راهنما:الگو]] [[he:עזרה:תבניות]] [[fi:Ohje:Malline]] [[bn:সাহায্য:টেমপ্লেট]] [[yi:הילף:מוסטער]] [[de:Hilfe:Vorlagen]] [[uk:Довідка:Шаблони]] [[hr:Wikipedija:Predlošci]]