Jump to content
MediaWiki

Extensión:DynamicPageList4

From mediawiki.org
This page is a translated version of the page Extension:DynamicPageList4 and the translation is 21% complete.
Outdated translations are marked like this.
Manual de extensiones de MediaWiki
DynamicPageList4
Estado de la versión: estable
Implementación Etiqueta , Función del analizador
Descripción Create lists of other articles based on their category, namespace, title, references or template usage and include contents or arguments of template calls of those articles into your page.
Autor(es) Universal Omega
Última versión 4.0.6 (2026年05月05日)
MediaWiki 1.44.0+
Cambios en la base de datos
Composer universal-omega/dynamic-page-list4
  • $wgDPLQueryCacheTime
  • $wgDPLFunctionalRichness
  • $wgDPLAllowUnlimitedCategories
  • $wgDPLCategoryStyleListCutoff
  • $wgDPLAllowedNamespaces
  • $wgDPLMaxCategoryCount
  • $wgDPLMaxResultCount
  • $wgDPLRunFromProtectedPagesOnly
  • $wgDPLRecursiveTagParse
  • $wgDPLAllowUnlimitedResults
  • $wgDPLRecursivePreprocess
  • $wgDPLMaxQueryTime
  • $wgDPLMinCategoryCount
  • $wgDPLOverrideParameterDefaults
  • $wgDPLAlwaysCacheResults
Licencia Licencia Pública General de GNU 3.0 o posterior
Descargar
Ejemplo DynamicPageList4 Manual
Traduce la extensión DynamicPageList4 si está disponible en translatewiki.net
This is a continuation/rewrite of Extension:DynamicPageList3 . It is a fully reworked code base, with significant code and database speed improvements, and is designed to be fully backward compatible with previous versions. It fixes numerous bugs and adds more features then previous versions and makes the extension more maintainable and secure by converting to MediaWiki's SelectQueryBuilder for example.

La extensión DynamicPageList4 es una herramienta de informes para MediaWiki, que enumera los miembros de las categorías y las intersecciones con varios formatos y detalles. Para la documentación completa, consulte el [[1]].

Cuando se invoca con un conjunto básico de parámetros de selección, DynamicPageList4 muestra una lista de páginas en una o más categorías. Las selecciones también pueden basarse en factores como el autor, el espacio de nombres, la fecha, el patrón de nombres, el uso de plantillas o las referencias a otros artículos. La producción adopta diversas formas, algunas de las cuales incorporan elementos de artículos seleccionados.

Esta extensión se invoca con la función parser {{#dpl: .... }} o la etiqueta parser ‎<DPL>. Una implementación compatible con Wikimedia de ciertas características puede ser invocada con ‎<DynamicPageList>.

Las búsquedas complejas pueden dar lugar a consultas en la base de datos que resulten costosas desde el punto de vista informático. Sin embargo, por defecto todos los resultados se almacenan en la caché durante un período de una hora para reducir la necesidad de volver a ejecutar la consulta cada vez que se carga la página. La página del manual Otros parámetros contiene información sobre los parámetros que pueden utilizarse para desactivar la caché y permitir las actualizaciones instantáneas.

Manual y documentación completa
DynamicPageList4 manual
Código fuente
Source code
Bugs y peticiones de características en GitHub
Issue and request tracker

Instalación

  • Descarga y extrae los archivos en el directorio «DynamicPageList4» dentro del directorio extensions/ existente.
  • Añade el siguiente código en la parte final de tu archivo LocalSettings.php :
    wfLoadExtension( 'DynamicPageList4' );
    
  • Si es necesario, configuralo a tu gusto.
  • Yes Hecho – Navega a Special:Version en el wiki para verificar que la extensión se haya instalado correctamente.

Configuración

These are DPL4's configuration settings, along with their default values.

To change them, ensure they are defined before including the extension on the wiki.

Opción Predeterminado Descripción
$wgDPLAllowedNamespaces [] By default, all existing namespaces are used when DPL4 initializes. Customize this setting with an array of namespace constants to restrict DPL4 to work only in those namespaces.
$wgDPLAllowUnlimitedCategories false Set this to true to ignore $wgDPLMaxCategoryCount and allow unlimited categories. Please note that large amounts of categories in a query can slow down or crash servers.
$wgDPLAllowUnlimitedResults false Set this to true to ignore $wgDPLMaxResultCount and allow unlimited results. Please note that large result sets may result in slow or failed page loads.
$wgDPLAlwaysCacheResults false Set this to true to ignore 'allowcachedresults' and always enable the parser cache.
$wgDPLCategoryStyleListCutoff 6 Maximum number of items in a category list before being cut off.
$wgDPLFunctionalRichness 3 Set the level of parameters available to end users.
$wgDPLMaxCategoryCount 8 Maximum number of categories to allow in queries.
$wgDPLMaxQueryTime 10000 Maximum allowed time for database queries in milliseconds.
$wgDPLMaxResultCount 500 Maximum number of results to return from a query.
$wgDPLMinCategoryCount 0 Minimum number of categories to allow in queries.
$wgDPLOverrideParameterDefaults [] An associative array of parameter names and their override values. These values replace the default parameter values defined in ParametersData, but only if the current defaults differ.
$wgDPLQueryCacheTime 0 Configure query cache time. The query cache cannot be purged. Suggested value between 30 to 600.
$wgDPLRecursivePreprocess true Use Parser::recursivePreprocess() to improve performance by preserving the internal cache, reducing redundant template parsing.
$wgDPLRecursiveTagParse false Do recursive tag parsing on ‎<dpl> parser tags converting tags and functions such as magic words like {{PAGENAME}}. This is similar to the {{#dpl}} parser function call, but may not work the same in all cases.
$wgDPLRunFromProtectedPagesOnly false Set this to true to allow DPL4 to run from protected pages only. This is recommended if wiki administrators are having issues with malicious users creating computationally intensive queries.

The global variable $wgNonincludableNamespaces is automatically respected by DynamicPageList4.

It will prevent the contents of the listed namespaces from appearing in DynamicPageList4's output.

$wgDPLMaxResultCount is a LIMIT on the SQL query itself. Some DynamicPageList4 query parameters like includematch are applied after the SQL query, however, so results here may easily be misleading.

Richness funcional

DynamicPageList4 has many features unlocked based on the maximum functional richness level.

Some can cause high CPU or database load and should be used sparingly.

  • $wgDPLFunctionalRichness = 0equivalent to Wikimedia's DynamicPageList (Intersection)
  • $wgDPLFunctionalRichness = 1adds additional formatting parameters
  • $wgDPLFunctionalRichness = 2adds performance equivalent features for templates and pagelinks
  • $wgDPLFunctionalRichness = 3allows more-expensive page inclusion features and regular expression queries
  • $wgDPLFunctionalRichness = 4not recommended for public websites. Includes debugging parameters for testing and development.

Uso

Funcionalidad DPL ampliada

Extended dynamic page lists are invoked by using the parser function {{#dpl: .... }}, or the parser extension tag ‎<DPL>...‎</DPL>.

See Manual - General Usage and Invocation Syntax and DPL:Parameters: Criteria for Page Selection

Compatibilidad con versiones anteriores

Functionality compatible with Wikimedia's DynamicPageList extension can be invoked with ‎<DynamicPageList>...‎</DynamicPageList>.

Further information can be found on the Compatibility manual page.


Filosofía de uso y visión general

With the assumption there are some articles written about countries those articles will typically have three things in common:

  • They will belong to a common category
  • They will have a similar chapter structure, i.e., they will contain paragraphs named 'Religion' or 'History'
  • They will use a template which is used to present highly structured short data items ('Capital', 'Inhabitants', ..) nicely (e.g., as a wikitable)

Generate a report based on countries

If there was a need to assemble a report of what countries practice a certain religion, this could be easily done with the category and linksto parameters.

{{#dpl:
category=countries
|linksto=Pastafarianism
}}

With DynamicPageList4, one could:

  • Generate a list of all those articles (or a random sample)
  • Show metadata of the articles (popularity, date of last update, ..)
  • Show one or more chapters of the articles ('transclude' content)
  • Show parameter values which are passed to the common template
  • Order articles appropriately
  • Present the result in a sortable table
  • Generate multiple column output

¿Qué pasos son necesarios?

Find the articles you want to list:

  • Select by a logical combination (AND, OR, NOT) of categories
  • Specify a range for the number of categories the article must be assigned to
  • Select by a logical combination (AND, OR, NOT) of namespaces
  • Define a pattern which must match the article's name
  • Name a page to which the article must or must not link
  • Name a template which the article must or must not use
  • Name a text pattern that must occur within external links from a page
  • Exclude or include redirections
  • Restrict your search to stable pages or quality pages ("flagged revisions")
  • Use other criteria for selection like the author, date of last change, etc.
  • Define regular expressions to match the contents of pages you want to include

Order the result list of articles according to

  • Article title
  • Article display title
  • Article size
  • Date of last change
  • Last user to make an edit

Define attributes you want to see

  • Article name
  • Article namespace
  • Article size
  • Date of last change
  • Date of last access
  • Last user to make an edit

Define contents you want to show

  • Whole article
  • Contents of certain sections (identified by headings)
  • Text portions (defined by special marker tags in the article)
  • Values of template calls
  • Use a custom template to show output

Define the output format

  • Specify header and footer for the default output
  • Use ordered list, unordered list
  • Use tables
  • Format table fields individually by applying templates to their content
  • Use category style listing
  • Truncate title or contents to a certain maximum length
  • Add a link to the article or one or more of its sections

Consideraciones

Rendimiento

DPL4's code execution and database access are typically fast for category and article lookups.

However, using loose LIKE and REGEXP match parameters and/or requesting large data sets can result in long database access times.

Parser time should also be taken into consideration.

For example, having the query of image results go into a template that displays them will result in a parser media transform for each one.

This can quickly eat up 2MBs of RAM per media transform.

It is recommended to configure the following configuration options:

  • $wgDPLMaxQueryTimeallows configuration of the max execution length for queries, in milliseconds
  • $wgDPLQueryCacheTimeallows configuration of the query cache. It also supports PoolCounter to limit query concurrency.


Véase también

Lectura adicional

DynamicPageList4 can do much more than we can explain here.

A complete manual is available with full parameter documentation.

Esta extensión está incluida en los siguientes anfitriones/granjas wiki y/o paquetes:

AltStyle によって変換されたページ (->オリジナル) /