(Changed categories.) |
No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 14: | Line 14: | ||
To do this, you need to make two changes: | To do this, you need to make two changes: | ||
# '''Add a wrapper and filter | # '''Add a wrapper and filter parameters:''' Apply a wrapper around your transclusion for formatting purposes and add some filter parameters to limit the results in the list. | ||
# '''Format the output:''' Remove the unnecessary information through some style adjustment in the page MediaWiki:Common.css (admin rights required) | # '''Format the output:''' Remove the unnecessary information through some style adjustment in the page MediaWiki:Common.css (admin rights required) | ||
Line 20: | Line 20: | ||
You can set some parameters 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):<syntaxhighlight lang="text"> | You can set some parameters 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):<syntaxhighlight lang="text"> | ||
<div class="rcinclude">{{Special:RecentChanges|limit=100|days=7|namespace=0}}</div> | <div class="rcinclude">{{Special:RecentChanges|limit=100|days=7|namespace=0}}</div> | ||
</syntaxhighlight>To show changes in additional namespaces, add them to the | </syntaxhighlight>To show changes in additional namespaces, add them to the namespace parameter, separated by a semi-colon:<syntaxhighlight lang="text"> | ||
<div class="rcinclude">{{Special:RecentChanges|limit=100|days=7|namespace=0;3010}}</div> | <div class="rcinclude">{{Special:RecentChanges|limit=100|days=7|namespace=0;3010}}</div> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Format the output === | === Format the output === | ||
After adding the <nowiki><div class=" | After adding the <nowiki><div class="rcinclude">...</div></nowiki> wrapper around your transclusion content, you can now use this ''rcinclude'' class to style the output and to hide some unnecessary information. This class is important, because it ensures that other pages in the wiki, such as the actual "Recent changes" special page or the version history pages in your wiki are not affected by these changes. | ||
To filter out additional detail information — such as change in file size, markers, or direct links to the version comparison — | 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):<syntaxhighlight lang="text"> | ||
/** custom formatting for recent changes that are included on a wiki page with a div-wrapper of css-class .rcinclude **/ | /** custom formatting for recent changes that are included on a wiki page with a div-wrapper of css-class .rcinclude **/ | ||
Line 38: | Line 38: | ||
.rcinclude .mw-changeslist-links, | .rcinclude .mw-changeslist-links, | ||
.rcinclude .mw-changeslist-separator, | .rcinclude .mw-changeslist-separator, | ||
.rcinclude .mw-rollback-link {display:none} | .rcinclude .mw-rollback-link {display:none} | ||
/* remove the "New" indicator | /* remove the "New" indicator and the time in front of each main entry - they can only be removed together */ | ||
.rcinclude td.mw-enhanced-rc {display:none} | .rcinclude td.mw-enhanced-rc {display:none} | ||
Line 57: | Line 56: | ||
/** end recent changes formatting **/ | /** end recent changes formatting **/ | ||
</syntaxhighlight>After saving these changes in MediaWiki:Common.css, you should now see the modified output of the transcluded content as shown in the previous screenshot. | </syntaxhighlight>After saving these changes in ''MediaWiki:Common.css'', you should now see the modified output of the transcluded content as shown in the previous screenshot. | ||
If you still see the original formatting, you will need to clear the network cache: | If you still see the original formatting, you will need to clear the network cache: | ||
Line 63: | Line 62: | ||
# '''Right-click''' on the wiki page that contains the "Recent changes" transclusion. | # '''Right-click''' on the wiki page that contains the "Recent changes" transclusion. | ||
# '''Click''' ''Inspect''. | # '''Click''' ''Inspect''. | ||
# Activate Disable cache | # '''Activate''' Disable cache | ||
# '''Press''' ''F5'' on your keyboard to refresh the page. | # '''Press''' ''F5'' on your keyboard to refresh the page. | ||
Line 69: | Line 68: | ||
[[en:{{FULLPAGENAME}}]] | [[en:{{FULLPAGENAME}}]] | ||
[[de:Letzte Änderungen Transklusion]] | [[de:Letzte Änderungen Transklusion]] | ||
[[Category:Organization]] | [[Category:Organization]] | ||
[[Category:Portal]] | [[Category:Portal]] |
Latest revision as of 15:32, 6 May 2022
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 the page Special:RecentChanges.
Limiting the displayed information
Sometimes, you might want to limit the information that is shown for recent changes.
To do this, you need to make two changes:
- Add a wrapper and filter parameters: Apply a wrapper around your transclusion for formatting purposes and add some filter parameters to limit the results in the list.
- Format the output: Remove the unnecessary information through some style adjustment in the page MediaWiki:Common.css (admin rights required)
Add a wrapper and filter parameters
You can set some parameters 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 namespace parameter, separated by a semi-colon:
<div class="rcinclude">{{Special:RecentChanges|limit=100|days=7|namespace=0;3010}}</div>
Format the output
After adding the <div class="rcinclude">...</div> wrapper around your transclusion content, you can now use this rcinclude class to style the output and to hide some unnecessary information. This class is important, because it ensures that other pages in the wiki, such as the actual "Recent changes" special page or the version history pages in your wiki are not affected by these changes.
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 {display:none}
/* remove the "New" indicator and the time in front of each main 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 **/
After saving these changes in MediaWiki:Common.css, you should now see the modified output of the transcluded content as shown in the previous screenshot.
If you still see the original formatting, you will need to clear the network cache:
- Right-click on the wiki page that contains the "Recent changes" transclusion.
- Click Inspect.
- Activate Disable cache
- Press F5 on your keyboard to refresh the page.