Help:Feed format

From semantic-mediawiki.org
Feed format
Exports results as RSS and Atom feeds.
Scenarios, examples, demos
Example: RSS news feed, Atom news feed
Collection
Further Information
Provided by: Semantic MediaWiki
Added: 1.8.0
Removed: still supported
Requirements: none
Format name: feed
Enabled? Indicates whether the result format is enabled by default upon installation of the respective extension. Yes
Authors: James Hong Kong
Categories: export · feed · xml
Table of Contents

The result format feed allows to export results as RSS and Atom feed format using the MediaWiki's export mechanisms. The default feed type is set to rss which can be changed using parameter |type=atom.

Starting with Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x. the following enhancements were made to this result format:

  • Support for handling media files was added1
  • Support for handling page titles with the {{DISPLAYTITLE}} magic word was added2


Please be aware, that the raw feed output is designed to be displayed in a syndication news reader and not optimized for the display in a web browser.

Parameters[edit]

General[edit]

Parameter Type Default Description
source text empty Alternative query source
limit whole number 50 The maximum number of results to return
offset whole number 0 The offset of the first result
link text all Show values as links
sort list of texts empty Property to sort the query by
order list of texts empty Order of the query sort
headers text show Display the headers/property names
mainlabel text no The label to give to the main page name
intro text empty The text to display before the query results, if there are any
outro text empty The text to display after the query results, if there are any
searchlabel text RSS Text for continuing the search
default text empty The text to display if there are no query results

Format specific[edit]

Parameter Aliases Type Default Description
type - text rss Feed type
title rsstitle text empty The text to be used as the title of the feed
description rssdescription text empty The text to be used as the description of the feed
page - text none Page content to be displayed with the feed
Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x. introduced a set of predefined classes supporting a datatable output34 which also allows for RSS export via result format "Table"Outputs the results in a table (default for queries with printout statements)..

Customization[edit]

Starting with Semantic MediaWiki 1.9.0Released on 3 January 2014 and compatible with MW 1.19.0 - 1.22.x. it is possible to add a linked icon to the searchlabel of an inline query. After you add the following code to your MediaWiki:Common.js page, a standard RSS feed icon will appear for all SMW RSS/Atom generated links (see also Searchlabel and further results).

/**
 * Additional linked icon for the searchlabel of result format "feed"
 *
 * @since 1.9.0
 *
 * @rev 1
 * @author mwjames
 */

$( '.smw-feed-furtherresults > a' ).addClass( 'feedlink' );

Examples[edit]



References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:1315
  2. ^  Semantic MediaWiki: GitHub pull request gh:smw:3162
  3. ^  Semantic MediaWiki: GitHub pull request gh:smw:2420
  4. ^  Semantic MediaWiki: GitHub pull request gh:smw:2718