Basculer le menu
Changer de menu des préférences
Basculer le menu personnel
Non connecté(e)
Votre adresse IP sera visible au public si vous faites des modifications.

« Modèle:Liste » : différence entre les versions

De Nefald
Hiob (discussion | contributions)
Aucun résumé des modifications
Hiob (discussion | contributions)
Aucun résumé des modifications
 
Ligne 1 : Ligne 1 :
<noinclude>{{Documentation}}</noinclude><includeonly>{{#invoke:Liste|main}}</includeonly>
<includeonly><dpl>
{{#if:{{{category|}}}|category={{{category}}}}}
{{#if:{{{notcategory|}}}|notcategory={{{notcategory}}}}}
{{#if:{{{namespace|}}}|namespace={{{namespace}}}}}
{{#if:{{{notnamespace|}}}|notnamespace={{{notnamespace}}}}}
{{#if:{{{titlematch|}}}|titlematch={{{titlematch}}}}}
{{#if:{{{notitlematch|}}}|notitlematch={{{notitlematch}}}}}
{{#if:{{{titleregexp|}}}|titleregexp={{{titleregexp}}}}}
{{#if:{{{nottitleregexp|}}}|nottitleregexp={{{nottitleregexp}}}}}
{{#if:{{{linksto|}}}|linksto={{{linksto}}}}}
{{#if:{{{notlinksto|}}}|notlinksto={{{notlinksto}}}}}
{{#if:{{{linksfrom|}}}|linksfrom={{{linksfrom}}}}}
{{#if:{{{notlinksfrom|}}}|notlinksfrom={{{notlinksfrom}}}}}
{{#if:{{{uses|}}}|uses={{{uses}}}}}
{{#if:{{{notuses|}}}|notuses={{{notuses}}}}}
{{#if:{{{usedby|}}}|usedby={{{usedby}}}}}
{{#if:{{{imageused|}}}|imageused={{{imageused}}}}}
{{#if:{{{imagecontainer|}}}|imagecontainer={{{imagecontainer}}}}}
{{#if:{{{redirects|}}}|redirects={{{redirects}}}}}
{{#if:{{{minrevisions|}}}|minrevisions={{{minrevisions}}}}}
{{#if:{{{maxrevisions|}}}|maxrevisions={{{maxrevisions}}}}}
{{#if:{{{minoredits|}}}|minoredits={{{minoredits}}}}}
{{#if:{{{modifiedby|}}}|modifiedby={{{modifiedby}}}}}
{{#if:{{{notmodifiedby|}}}|notmodifiedby={{{notmodifiedby}}}}}
{{#if:{{{lastmodifiedby|}}}|lastmodifiedby={{{lastmodifiedby}}}}}
{{#if:{{{notlastmodifiedby|}}}|notlastmodifiedby={{{notlastmodifiedby}}}}}
{{#if:{{{createdby|}}}|createdby={{{createdby}}}}}
{{#if:{{{notcreatedby|}}}|notcreatedby={{{notcreatedby}}}}}
 
ordermethod={{{ordermethod|{{{tri|title}}}}}}
{{#if:{{{order|}}}|order={{{order|{{{ordre|ascending}}}}}}}}
{{#if:{{{ordercollation|}}}|ordercollation={{{ordercollation}}}}}
{{#if:{{{count|}}}|count={{{count|{{{limite|500}}}}}}}}
{{#if:{{{offset|}}}|offset={{{offset}}}}}
{{#if:{{{randomseed|}}}|randomseed={{{randomseed}}}}}
{{#if:{{{randomcount|}}}|randomcount={{{randomcount}}}}}
{{#if:{{{distinct|}}}|distinct={{{distinct}}}}}
 
mode={{#switch:{{{format|userformat}}}
  |liste=unordered
  |puces=unordered
  |ul=unordered
  |numerotee=ordered
  |ol=ordered
  |inline=inline
  |category=category
  |#default={{{mode|userformat}}}
}}
 
{{#if:{{{columns|}}}|columns={{{columns|{{{colonnes|1}}}}}}}}
{{#if:{{{rows|}}}|rows={{{rows|{{{lignes|1}}}}}}}}
{{#if:{{{rowsize|}}}|rowsize={{{rowsize}}}}}
{{#if:{{{rowcolformat|}}}|rowcolformat={{{rowcolformat}}}}}
 
{{#ifeq:{{{format|userformat}}}|tableau|
|{{#if:{{{table|}}}|table={{{table}}}|table={{{tableintro|{{{!}} class="wikitable sortable"}}}
! {{{colonnes_noms|Page}}}}}}
|{{#if:{{{tablerow|}}}|tablerow={{{tablerow}}}|tablerow={{{lignetableau|{{!}}-
{{!}} [[%PAGE%]]}}}}}},
{{#if:{{{listseparators|}}}|listseparators={{{listseparators}}}|listseparators={{{intro|{{{debut|}}}}}},{{{separator|{{{separateur|}}}}}},{{{outro|{{{fin|}}}}}}{{#ifeq:{{{format|}}}|tableau|{{!}}}{{!}}|}}}}
}}
 
{{#if:{{{inlinetext|}}}|inlinetext={{{inlinetext}}}}}
{{#if:{{{format|}}}|{{#ifneq:{{{format}}}|tableau|{{#ifneq:{{{format}}}|liste|{{#ifneq:{{{format}}}|puces|{{#ifneq:{{{format}}}|numerotee|format={{{format}}}}}}}}}}}}}
 
{{#if:{{{replaceintitle|}}}|replaceintitle={{{replaceintitle}}}}}
 
{{#if:{{{include|}}}|include={{{include}}}|{{#if:{{{infobox|}}}|include={{{infobox}}}:{{#if:{{{champs|}}}|{{{champs}}}|*}}{{#if:{{{shortdesc|}}}|,#REDIRECT,<nowiki>{{</nowiki>Short description<nowiki>}}</nowiki>}}|{{#if:{{{shortdesc|}}}|include=#REDIRECT,<nowiki>{{</nowiki>Short description<nowiki>}}</nowiki>}}}}}}
{{#if:{{{exclude|}}}|exclude={{{exclude}}}}}
{{#if:{{{includepage|}}}|includepage={{{includepage}}}}}
{{#if:{{{excludepage|}}}|excludepage={{{excludepage}}}}}
{{#if:{{{includematch|}}}|includematch={{{includematch}}}}}
{{#if:{{{excludematch|}}}|excludematch={{{excludematch}}}}}
{{#if:{{{includematchparsed|}}}|includematchparsed={{{includematchparsed}}}}}
{{#if:{{{excludematchparsed|}}}|excludematchparsed={{{excludematchparsed}}}}}
{{#if:{{{includemaxlength|}}}|includemaxlength={{{includemaxlength}}}}}
{{#if:{{{ignorecase|}}}|ignorecase={{{ignorecase}}}}}
 
{{#if:{{{shownamespace|}}}|shownamespace={{{shownamespace}}}}}
{{#if:{{{escapelinks|}}}|escapelinks={{{escapelinks}}}}}
{{#if:{{{skipthispage|}}}|skipthispage={{{skipthispage}}}}}
{{#if:{{{noparse|}}}|noparse={{{noparse}}}}}
 
{{#if:{{{dominantsection|}}}|dominantsection={{{dominantsection}}}}}
{{#if:{{{headingmode|}}}|headingmode={{{headingmode}}}}}
{{#if:{{{secseparators|}}}|secseparators={{{secseparators}}}}}
{{#if:{{{multisecseparators|}}}|multisecseparators={{{multisecseparators}}}}}
 
{{#if:{{{titlemaxlength|}}}|titlemaxlength={{{titlemaxlength}}}}}
{{#if:{{{resultsheader|}}}|resultsheader={{{resultsheader}}}}}
{{#if:{{{resultsfooter|}}}|resultsfooter={{{resultsfooter}}}}}
{{#if:{{{oneresultheader|}}}|oneresultheader={{{oneresultheader}}}}}
{{#if:{{{oneresultfooter|}}}|oneresultfooter={{{oneresultfooter}}}}}
{{#if:{{{noresultsheader|}}}|noresultsheader={{{noresultsheader|{{{siaucun|<div style="color:#999;font-style:italic;">Aucun résultat trouvé.</div>}}}}}}}}
{{#if:{{{noresultsfooter|}}}|noresultsfooter={{{noresultsfooter}}}}}
 
allowcachedresults={{#if:{{{cache|}}}|{{{cache}}}|{{#if:{{{allowcachedresults|}}}|{{{allowcachedresults}}}|false}}}}
{{#if:{{{reset|}}}|reset={{{reset}}}}}
{{#if:{{{eliminate|}}}|eliminate={{{eliminate}}}}}
{{#if:{{{openreferences|}}}|openreferences={{{openreferences}}}}}
{{#if:{{{ignoreuselessarticle|}}}|ignoreuselessarticle={{{ignoreuselessarticle}}}}}
{{#if:{{{execandexit|}}}|execandexit={{{execandexit}}}}}
{{#if:{{{redirects|}}}|redirects={{{redirects}}}}}
{{#if:{{{stablepages|}}}|stablepages={{{stablepages}}}}}
{{#if:{{{qualitypages|}}}|qualitypages={{{qualitypages}}}}}
 
{{#if:{{{debug|}}}|debug={{{debug}}}}}
{{#if:{{{goal|}}}|goal={{{goal}}}}}
{{#if:{{{suppresserrors|}}}|suppresserrors={{{suppresserrors}}}}}
</dpl></includeonly><noinclude>
== Documentation ==
 
Modèle universel pour [https://www.mediawiki.org/wiki/Extension:DynamicPageList4 DynamicPageList4] avec extraction automatique de contenu.
 
=== Paramètres simplifiés ===
 
==== Sélection ====
{| class="wikitable"
! Paramètre !! Alias !! Description !! Exemple
|-
| '''category''' || || Catégorie(s) || Plugin installé
|-
| '''notcategory''' || || Exclure catégorie(s) || Plugin obsolète
|-
| '''namespace''' || || Namespace(s) || Main{{!}}Template
|-
| '''titlematch''' || || Pattern du titre || World%
|-
| '''linksto''' || || Liens vers || Architecte
|-
| '''uses''' || || Utilise template || Template:InfoPlugin
|}
 
==== Tri et limite ====
{| class="wikitable"
! Paramètre !! Alias !! Description !! Valeurs
|-
| '''ordermethod''' || '''tri''' || Méthode de tri || title, lastedit, created, category, popularity
|-
| '''order''' || '''ordre''' || Ordre || ascending, descending
|-
| '''count''' || '''limite''' || Nombre max || 100
|-
| '''offset''' || || Décalage || 20
|}
 
==== Format d'affichage ====
{| class="wikitable"
! Paramètre !! Alias !! Description !! Valeurs
|-
| '''format''' || || Format global || tableau, liste, puces, numerotee, inline, category, userformat
|-
| '''intro''' || '''debut''' || Texte avant || <nowiki><div class="liste"></nowiki>
|-
| '''outro''' || '''fin''' || Texte après || <nowiki></div></nowiki>
|-
| '''separator''' || '''separateur''' || Entre items || <nowiki><hr></nowiki>
|-
| '''columns''' || '''colonnes''' || Nombre colonnes || 3
|}
 
==== Extraction de contenu ====
{| class="wikitable"
! Paramètre !! Description !! Exemple
|-
| '''shortdesc''' || Extraire Short description || yes
|-
| '''infobox''' || Template infobox || InfoPlugin
|-
| '''champs''' || Champs de l'infobox || description,documentation
|-
| '''include''' || Inclusion manuelle || {InfoPlugin}:description,#REDIRECT
|}
 
==== Variables disponibles ====
 
Dans '''format''', '''tablerow''' ou '''listseparators''' :
* '''%PAGE%''' : nom de la page
* '''%TITLE%''' : titre affiché
* '''%NAMESPACE%''' : namespace
* '''%IMAGE%''' : première image
* '''%EXTERNALLINK%''' : premier lien externe
* '''%SIZE%''' : taille en octets
* '''%AUTHOR%''' : créateur
* '''%DATE%''' : date création
* '''%LASTEDIT%''' : dernière modification
* '''%PAGESEL%''' : contenu extrait (via include)
* '''%PAGESEL:n%''' : n-ième élément extrait
 
=== Exemples d'utilisation ===
 
==== 1. Liste simple avec Short description ====
<pre>
{{Liste
|category=Plugin installé
|shortdesc=yes
|format=* [[%PAGE%]] — %PAGESEL:1%
}}
</pre>
 
==== 2. Tableau avec données d'infobox ====
<pre>
{{Liste
|category=Plugin installé
|format=tableau
|infobox=InfoPlugin
|champs=description,documentation
|colonnes_noms=Plugin !! Description !! Documentation
|lignetableau={{!}}-
{{!}} [[%PAGE%]] {{!}}{{!}} %PAGESEL:1% {{!}}{{!}} [%PAGESEL:2% Lien]
}}
</pre>
 
==== 3. Cartes en grille avec shortdesc ====
<pre>
{{Liste
|category=Plugin installé
|shortdesc=yes
|tri=lastedit
|ordre=descending
|intro=<div style="display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:20px;">
|format=<div style="border:1px solid #ddd; padding:15px;">
<h3>[[%PAGE%]]</h3>
<p>%PAGESEL:1%</p>
<small>Modifié: %LASTEDIT%</small>
</div>
|outro=</div>
|separateur=
}}
</pre>
 
==== 4. Tableau complet plugins avec tout ====
<pre>
{{Liste
|category=Plugin installé
|shortdesc=yes
|infobox=InfoPlugin
|champs=description,documentation,version
|format=tableau
|tableintro={{{!}} class="wikitable sortable"
! Plugin !! Short Desc !! Description !! Doc !! Version !! Taille !! Dernière modif
|lignetableau={{!}}-
{{!}} [[%PAGE%]]
{{!}}{{!}} %PAGESEL:1%
{{!}}{{!}} %PAGESEL:2%
{{!}}{{!}} {{#if:%PAGESEL:3%|[%PAGESEL:3% 📄]|—}}
{{!}}{{!}} %PAGESEL:4%
{{!}}{{!}} %SIZE% octets
{{!}}{{!}} %LASTEDIT%
|tri=title
|limite=100
}}
</pre>
 
==== 5. Liste avec regex d'extraction ====
<pre>
{{Liste
|category=Plugin installé
|includematch=/\|description=(.*?)[\n\|]/s
|format=* [[%PAGE%]]: %PAGESEL:1%
}}
</pre>
 
==== 6. Mode category (galerie) ====
<pre>
{{Liste
|category=Plugin installé
|format=category
|tri=category
|colonnes=4
}}
</pre>
 
==== 7. Recherche textuelle ====
<pre>
{{Liste
|category=Plugin installé
|includematchparsed=/world|construction/i
|shortdesc=yes
|format=puces
}}
</pre>
 
==== 8. Top 10 pages modifiées ====
<pre>
{{Liste
|category=Plugin installé
|tri=lastedit
|ordre=descending
|limite=10
|format=numerotee
}}
</pre>
 
==== 9. Extraction multiple avec shortdesc ====
<pre>
{{Liste
|category=Grade
|shortdesc=yes
|infobox=InfoGrade
|champs=couleur,permissions
|intro=<div class="grades">
|format=<div class="grade" style="border-left:4px solid %PAGESEL:2%;">
<h3>[[%PAGE%]]</h3>
<p><strong>Description:</strong> %PAGESEL:1%</p>
<p><strong>Permissions:</strong> %PAGESEL:3%</p>
</div>
|outro=</div>
|separateur=
}}
</pre>
 
==== 10. Debug mode ====
<pre>
{{Liste
|category=Plugin installé
|shortdesc=yes
|debug=true
|limite=5
}}
</pre>
 
=== Format des infobox requis ===
 
Pour que l'extraction fonctionne, structure tes infobox ainsi :
 
<pre>
<includeonly>{{#tag:dpl|
...paramètres...
include={{{1|InfoPlugin}}}:description,{{{1|InfoPlugin}}}:documentation
...
}}</includeonly>
</pre>
 
Et dans les pages :
 
<pre>
{{InfoPlugin
|description=Plugin de construction avancé
|documentation=https://example.com/doc
|version=1.2.3
}}
 
{{Short description|Plugin Minecraft pour construction}}
 
Le reste du contenu...
</pre>
 
=== Ordre d'extraction ===
 
Quand tu utilises :
<pre>
|shortdesc=yes
|infobox=InfoPlugin
|champs=description,documentation
</pre>
 
Les %PAGESEL:n% correspondent à :
* '''%PAGESEL:1%''' = Short description
* '''%PAGESEL:2%''' = InfoPlugin.description
* '''%PAGESEL:3%''' = InfoPlugin.documentation
 
=== Paramètres DPL4 avancés ===
 
Tous les paramètres [https://www.mediawiki.org/wiki/Extension:DynamicPageList4 DPL4] sont supportés :
* '''redirects''', '''stablepages''', '''qualitypages'''
* '''minrevisions''', '''maxrevisions''', '''minoredits'''
* '''modifiedby''', '''createdby''', '''lastmodifiedby'''
* '''imageused''', '''imagecontainer'''
* '''replaceintitle''', '''titlemaxlength'''
* '''dominantsection''', '''headingmode'''
* '''escapelinks''', '''shownamespace'''
* '''allowcachedresults''', '''reset''', '''eliminate'''
 
=== Dépannage ===
 
==== Aucun résultat ====
1. Vérifie que les pages sont dans la bonne catégorie
2. Active '''debug=true'''
3. Vérifie le nom de l'infobox
 
==== Extraction vide ====
1. Vérifie que le template {{Short description}} existe
2. Vérifie le format de ton infobox
3. Utilise '''debug=true''' pour voir les valeurs extraites
 
==== Performance ====
* Limite avec '''count'''
* Active le cache : '''cache=true'''
* Évite '''includematchparsed''' sur beaucoup de pages
 
[[Catégorie:Modèle]]
[[Catégorie:DPL]]
</noinclude>