Recent changes transclusion

Revision as of 16:22, 5 May 2022 by Margit Link-Rodrigue (talk | contribs) (Created page with "It is possible to include the results of the "Recent changes" special page in a wiki page. == Adding the changelist to a page == To show the Recent changes list on any page i...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

It is possible to include the results of the "Recent changes" special page in a wiki page.

Adding the changelist to a page

To show the Recent changes list on any page in the wiki, you can simply transclude it by adding the following to your page source:

{{Special:RecentChanges}}

This will simply output the same content as is shown on Special:RecentChanges.

Recent changes included in a wiki page
Recent changes included in a wiki page

Limiting the displayed information

Sometimes, you might want to limit the information that is shown for recent changes.

Recent changes filtered view
Recent changes filtered view


To do this, you need to make two changes:

  1. Adjusting the tag: Apply a wrapper around your transclusion tag and add some filter parameters to the tag itself.
  2. Formatting the output: Remove the unnecessary information through some style adjustment in the page MediaWiki:Common.css (admin rights required)

Adjusting the tag

You can set some paramters in the tag to filter some information. The following example shows up to the latest 100 changes in the last 7 days in the main namespace (Pages)

<div class="rcinclude">{{Special:RecentChanges|limit=100|days=7|namespace=0}}</div>

To show changes in additional namespaces, add them to the namepace parameter, separated by a semi-colon:

<div class="rcinclude">{{Special:RecentChanges|limit=100|days=7|namespace=0;3010}}</div>

Formatting the output

To filter out additional detail information — such as change in file size, markers, or direct links to the version comparison —, add the following to the page MediaWiki:Common.css (admin rights required):

/** custom formatting for recent changes that are included on a wiki page with a div-wrapper of css-class .rcinclude **/

/* first style declaration hides all unnecessary info such as bytes, direct links to differences, links related to user, and markers */
.rcinclude .mw-changeslist-line-inner-userTalkLink,
.rcinclude .mw-diff-bytes, 
.rcinclude .mw-tag-markers,
.rcinclude .mw-changeslist-legend,
.rcinclude .mw-changeslist-line-inner-rollback,
.rcinclude .mw-changeslist-links,
.rcinclude .mw-changeslist-separator,
.rcinclude.mw-rollback-link, 
.rcinclude .mw-rollback-link {display:none}

/* remove the "New" indicator from the time in front of each entry - they can only be removed together */
.rcinclude td.mw-enhanced-rc {display:none} 

/* increase spacing between entries */
.rcinclude .mw-changeslist-line {margin-bottom:0.6em} 

/* separate page title and user name */
.rcinclude .mw-title::after {content:" -"} 

/* make the day heading more compact */
.rcinclude .mw-changeslist h4 {font-size:0.95em; margin:1em 0 0.5em 0}  

/* remove unnecessary space in the expanded version rows */
.rcinclude tr.mw-rcfilters-ui-highlights-enhanced-nested td:nth-child(3){display:none}   

/** end recent changes formatting  **/



To submit feedback about this documentation, visit our community forum.