User:Adaz: Difference between revisions

Jump to navigation Jump to search
72 bytes added ,  10 November 2022
m
no edit summary
(Begining of translation)
mNo edit summary
Line 15: Line 15:
  Bonjour à tous !
  Bonjour à tous !


Typing the following on a page would copy that content to the page you are editing. Note that the first character is not case sensitive.
Taper ce qui suit sur une page copierait ce contenu sur la page que vous éditez. Notez que le premier caractère n'est pas sensible à la casse.
  <pre>{{helloworld}}</pre>
  <pre>{{banjouratous}</pre>


However, the templates can in addition to MediaWiki, html and style sheet markup also use a wide range of special functions to do a lot, lot more.
Cependant, les modèles peuvent, en plus du balisage MediaWiki, HTML et feuille de style, utiliser également un large éventail de fonctions spéciales pour faire beaucoup, beaucoup plus.


=== Different types of templates ===
=== Different types of templates ===
Line 75: Line 75:
In the template documentation there is also a list of the parameters and how they are supposed to be used and there are often examples to illustrate the different ways the parameters can be used.
In the template documentation there is also a list of the parameters and how they are supposed to be used and there are often examples to illustrate the different ways the parameters can be used.


== Creating new templates ==
== La création de nouveaux modèles ==
=== Choosing a good name ===
=== Choosing a good name ===
Consider giving the template a meaningful name.  Usually one would try to only have the initial character upper case.  If you are mimicking a template on another wiki, using its name might be a good idea.  If the template will be used very often it might actually be a good idea to use a very short name or an abbreviation, but proper categorisation and documentation will then be even more important.  Do note that parameter names are case sensitive except for the first character.
Consider giving the template a meaningful name.  Usually one would try to only have the initial character upper case.  If you are mimicking a template on another wiki, using its name might be a good idea.  If the template will be used very often it might actually be a good idea to use a very short name or an abbreviation, but proper categorisation and documentation will then be even more important.  Do note that parameter names are case sensitive except for the first character.
Line 92: Line 92:
While the template always can be fixed if there are errors it is better to have an extra preview than an extra edit.  Do note that the template will be lost if you do not save it.
While the template always can be fixed if there are errors it is better to have an extra preview than an extra edit.  Do note that the template will be lost if you do not save it.


== Editing templates ==
== Modification d'un modèle ==
Editing a template is often as easy as editing a normal wiki page.  Lets say you want to edit a template with the name ''what you always wanted to know''. Either search for the template using the template namespace like ''Template:What you always wanted to know'' or click on a link to get you there.
Editing a template is often as easy as editing a normal wiki page.  Lets say you want to edit a template with the name ''what you always wanted to know''. Either search for the template using the template namespace like ''Template:What you always wanted to know'' or click on a link to get you there.


Line 185: Line 185:
Apart from '''demospace''' some templates will have a '''nocat''' parameter that when not empty or set as '''nocat = yes''' will suppress categorisation altogether.
Apart from '''demospace''' some templates will have a '''nocat''' parameter that when not empty or set as '''nocat = yes''' will suppress categorisation altogether.


== Translating templates ==
== Traduire un modèle ==
Templates are translated in a different way than [[Help:Translate|normal articles]].  Instead of creating another page for each translation, all translations are written within one template.  To do that one can use the {{tl|LangSwitch}} template, for example like below.
Templates are translated in a different way than [[Help:Translate|normal articles]].  Instead of creating another page for each translation, all translations are written within one template.  To do that one can use the {{tl|LangSwitch}} template, for example like below.


Line 217: Line 217:
| lang = fr }}</nowiki>
| lang = fr }}</nowiki>


== Advanced template editing ==
== Edition avancée d'un modèle ==
The templates can contain some very advanced and often complex code, but even easier code can do great things to make life easier for you as an editor using it later.
The templates can contain some very advanced and often complex code, but even easier code can do great things to make life easier for you as an editor using it later.


Line 233: Line 233:
A good hint on getting more readable template source is that well placed HTML comments (<tt>&lt;!-- Comment --&gt;</tt>) will help a lot.   
A good hint on getting more readable template source is that well placed HTML comments (<tt>&lt;!-- Comment --&gt;</tt>) will help a lot.   


== External links ==
== Liens connexes ==
* {{mediawiki|Help:Templates|MediaWiki template help}}
* {{mediawiki|Help:Templates|MediaWiki template help}}


482

edits

Navigation menu