9

I am a complete and total newbie with MediaWiki. I would like to find a way to include Recent Changes directly on the Main Page, without having to have the user navigate to the recent changes page. What are my options for this?

Thanks!

4 Answers 4

24

One way would be to put

{{Special:RecentChanges}}

in [[Main_Page]].

2
  • 4
    You can also set the number of changes to show: e.g. {{Special:RecentChanges/5}}.
    – svick
    Mar 7, 2013 at 16:43
  • Help page describing this feature is here: mediawiki.org/wiki/Help:Recent_changes Also I would recommend linking the bigger recent changes pages with a "more recent changes..." link. You can wrap all of this in a template too. See how I did it here: wiki.opendataday.org/Template:Recent_changes_box (This allows you to then put {{Recent changes box}} on the Main Page)
    – Harry Wood
    Mar 6, 2015 at 16:35
2

The News extension (available at http://www.mediawiki.org/wiki/Extension:News ) is a way to do this very simply, and can be customized so that the entire recent changes page is not displayed. Just install the extension and then adding the

<news/>

tag will include the 10 most recent changes. Parameters to change the number of items shown, exclude minor changes, or format how they are displayed are available on the website linked above.

1

There is also an extension : Dynamic Article List - which allows you more control over what to display in your list of recent changes.

http://meta.wikimedia.org/wiki/User:Socoljam/DynamicArticleList_%28enhanced%29

This is an enhanced version of a MediaWiki extension of the same name. It also provides slightly clearer instructions to install it and get it working.

3
  • I looked at the article and it looks fairly straightforward, but how would I apply that to the Recent Changes list?
    – Mike Cole
    Mar 12, 2010 at 4:17
  • Unless I am misunderstanding your question, there is no way to change the Recent Changes list to use this extension. The idea is to create your own 'recent changes' page with a simplified layout using this extension. In your situation, you would create a new template: 'Template:Recent_changes' and use the extension there before embedding the template in your main page. Mar 18, 2010 at 13:11
  • @MikeCole example for recent changes: <DynamicArticleList> title=My Recent Changes type=update </DynamicArticleList> Put this code on your main page. You can use another words like title=new`. I am using this plugin on my mediawiki, very helpful for quick navigation.
    – Sonique
    Jun 20, 2014 at 6:20
0

I wanted the same thing, but in a much simpler list than the full output of {{Special:RecentChanges}}. The following database query gives just the page names of the changes in the last 30 days, without the recently deleted pages:

SELECT DISTINCT rc_title
FROM recentchanges
WHERE rc_timestamp > (CURRENT_DATE - INTERVAL '30 days')
AND rc_new_len > 0
ORDER BY rc_title

(This is with PostgreSQL. It might be slightly different with MySQL)

To put that on the Main page, I used the ExternalData extension with it's #get_db_data function.

In LocalSettings.php:

wfLoadExtension( 'ExternalData' );

$wgExternalDataSources['mydb'] = [
    'server'   => '127.0.0.1',  // or 'yourwiki.example.com',
    'type'     => 'postgres',   // mysql, postgres, sqlite, ...
    'name'     => 'wikidb',     // wiki DB name
    'user'     => 'backup_bot', // user with only "SELECT" rights
    'password' => ''
];

Then, in the Main_page:

{{#get_db_data:
 db=mydb
 |from=recentchanges
 |where=rc_timestamp > (CURRENT_DATE - INTERVAL '30 days') AND rc_new_len > 0
 |order by=rc_title
 |group by=rc_title
 |data= title=rc_title
 |suppress error
}}

Changes in the last 30 days:
{| class="wikitable"
    ! title
{{#for_external_table:<nowiki/>
      {{!}}-
      {{!}} {{{title}}}
}}
|}

Or as a simple list:
{{#for_external_table:&nbsp;
* [[{{{title}}}]]
}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.