Extension:FeaturedFeeds

This page is a translated version of the page Extension:FeaturedFeeds and the translation is 100% complete.
Manuel des extensions MediaWiki
FeaturedFeeds
État de la version : stable
px
Implémentation Extraction de données, API , Accroche
Description Ajoute des flux de syndication de contenu en vedette du wiki
Auteur(s) Max Semenik (MaxSemdiscussion)
Dernière version continuous updates
MediaWiki 1.19+
PHP 5.4+
Modifie la base
de données
Non
Licence WTFPL v2.0
Téléchargement
CHANGELOG
  • $wgFeaturedFeedsDefaults
  • $wgDisplayFeedsInSidebar
  • $wgFeaturedFeeds
Téléchargements trimestriels 8 (Ranked 124th)
Utilisé par les wikis publics 876 (Ranked 273rd)
Traduire l’extension FeaturedFeeds sur translatewiki.net si elle y est disponible
Problèmes Tâches ouvertes · Signaler un bogue

FeaturedFeeds est une extension qui crée des flux quotidiens (Atom ou RSS) du contenu mis en vedette du wiki (allant des articles de qualité ou des articles en vedette aux Média du jour).

Les flux sont ajoutés à la page principale du site et sont disponibles via le module API featuredfeed. Voir aussi (en anglais) : Extension:FeaturedFeeds/WMF deployment

Utilisation des flux en vedette (FeaturedFeeds)

Cette extension exige que les wikis utilisent un processus automatisé pour publier leur contenu présenté quotidiennement (ou au moins très souvent).

Installation

  • Téléchargez et placez le(s) fichier(s) dans un répertoire appelé FeaturedFeeds dans votre dossier extensions/.
    Les développeurs et les contributeurs au code doivent à la place installer l'extension à partir de Git en utilisant:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/FeaturedFeeds
  • Ajoutez le code suivant à la fin de votre fichier LocalSettings.php  :
    wfLoadExtension( 'FeaturedFeeds' );
    
  •   Fait – Accédez à Special:Version sur votre wiki pour vérifier que l'extension a bien été installée.

Configuration

A wiki must have some means of caching set up to use FeaturedFeeds, or everything will be super slow.

Paramètres

Variable name Description
$wgFeaturedFeeds Contains array of feed definitions in the following format:
'feed name' => [
	'page' => <message name>,
	'title' => <message name>,
	'description' => <message name>,
	'entryName' => <message name>,
]

Mandatory items:

'page'
Name of the interface message that contains an expression that evaluates to the title of the page with today's feed entry. For example, for English Wikipedia's featured articles feed it could contain Wikipedia:Today's featured article/{{#time:F j, Y}} that evaluates (using ParserFunctions, but ordinary date/time magic words may be used as well) to Wikipedia:Today's featured article/novembre 2, 2024. This message always uses content language.
'title'
Name of the interface message that contains feed title, for example "My Page of the Day Feed".
'description'
A longer description of the feed, used for ‎<subtitle> Atom element, and ‎<description> RSS element.
'entryName'
Name of the interface message that contains heading of feed's individual entries.

Also see below for optional settings.

$wgFeaturedFeedsDefaults Provides default values for some parameters of every feed from $wgFeaturedFeeds.

Default value:

[
	'limit' => 10,
	'inUserLanguage' => false,
]
'limit'
Maximum number of entries (ie number of days) in the feed.
'inUserLanguage'
Whether user's preferred language should be honored by the feed. For example, it doesn't make much sense to have English Wikipedia's featured articles feed in languages other than English as the content is always in English anyway. But Commons' picture of the day feed contains images and their descriptions that are available in many languages, so it actually benefits from its description's localisation.
$wgDisplayFeedsInSidebar Whether links to feeds should be displayed in sidebar on main page

Configuration du site

Voir la sous-page complète pour plus de détails sur la configuration des projets Wikimedia (en anglais)


Message names

Each feed has the following messages controlling its behavior (replace * with feed name, chosen among those above):

Message Description Example
ffeed-*-page Title of the page that contains day's featured content.
Has one optional parameter, $1, which gets substituted with feed language code for use in multilingual feeds (currently, only on Commons).
Wikipedia:Today's featured article/{{#time:F j, Y}}
ffeed-*-title Feed name Wikipedia featured articles feed
ffeed-*-short-title Short feed name, could be used on sidebar in the future Featured articles
ffeed-*-desc More lengthy feed description Best articles on Wikipedia!!!
ffeed-*-entry Title of each day's entry {{CURRENTMONTHNAME}} {{CURRENTDAY}} Wikipedia featured article

How to set up a feed

Create a page named MediaWiki:Ffeed-*-page containing the page title (again, replace * with the feed's name). Two cases are possible here:

  • The wiki has a new page for each day, e.g. Wikipedia:Today's featured article/novembre 2, 2024 on the English Wikipedia. In such case, the title can use date and time magic words or #time parser functions to incorporate the date in the page title. The title in the example here is Wikipedia:Today's featured article/{{#time:F j, Y}}.
  • The wiki uses a single template that uses date magic internally to display proper content. In such cases, either point MediaWiki:Ffeed-*-page to that template directly, or, if it has ‎<noinclude> sections not intended for readers to see, point it to a page that contains a transclusion of the said template and nothing else.
If you need to translate or tweak interface messages of a feed, do that before creating MediaWiki:Ffeed-*-page, otherwise your new feed might take up to one hour to catch up these changes.

How to publish feeds in the sidebar

Just create page MediaWiki:Ffeed-enable-sidebar-links with content other than a dash (-) or an empty string. A section called "Featured content feeds" will appear in the sidebar on the main page.


Module API

www.mediawiki.org n'a pas de flux en vedette, donc la documentation de l'API générée sur ce wiki n'est pas très utile

Au lieu de cela, consultez la documentation de l'API générée sur enwiki, qui répertorie les flux qu'elle fournit et contient un exemple fonctionnel.