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!

Mike Cole
  • 14,474
  • 28
  • 114
  • 194

4 Answers4

24

One way would be to put

{{Special:RecentChanges}}

in [[Main_Page]].

Joshua C. Lerner
  • 1,910
  • 17
  • 12
  • 4
    You can also set the number of changes to show: e.g. `{{Special:RecentChanges/5}}`. – svick Mar 07 '13 at 16:43
  • Help page describing this feature is here: https://www.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: http://wiki.opendataday.org/Template:Recent_changes_box (This allows you to then put {{Recent changes box}} on the Main Page) – Harry Wood Mar 06 '15 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.

Cory
  • 41
  • 1
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.

Laurent Alquier
  • 514
  • 2
  • 4
  • 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 '10 at 04: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. – Laurent Alquier Mar 18 '10 at 13:11
  • @MikeCole example for recent changes: ` title=My Recent Changes type=update ` 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 '14 at 06: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}}}]]
}}
mivk
  • 13,452
  • 5
  • 76
  • 69