RP Log Sorting on Mediawiki
-
I remember some time ago, some individuals asking about a way to sort mediawiki RP logs by date. I've been experimenting and have found a way to do so, easily, and it defaults to a descending date sort and offers other sort options. The ultimate output is a four section table (noted by the sections below), with sort options that has a descending date sort.
You need the following things:
Log Template:
Format this however you want, but make sure you've got your sections clearly noted. The display method I use, uses the following:- The Template is named Template:Log
- It uses Category:RP Log as the main thing it pulls from for data
- And then uses the GAMEDATE, TITLE, CHARLIST and SUMMARY sections for sorting and default display.
This first portion is for all logs, ignoring the template defaults from the sort, sorted by descending date in the YYYY-MM-DD format:
<dpl> category = RP Log nottitlematch=LogTemplate|Log noresultsheader = <center>''No logs available.''</center> order = descending ordermethod=title include ={Log}:gamedate:[[%PAGE%|%TITLE%]]:summary:charlist table=id="logtable" class="sortable wikitable",-,IC Date,Title,Summary,Participants tablerow=width="8%" class="gamedate"¦%%,width="22%" class="title"¦%%,width="45%" class="summary"¦%%,width="25%" class="charlist"¦%%,¦%% </dpl>
The next example is for use on a character page, and will grab any logs that link to that page (or any other page, really, based on the link).
<dpl> category = RP Log nottitlematch=LogTemplate|Log linksto = Page Name noresultsheader = <center>''No logs available.''</center> order = descending ordermethod=title include ={Log}:gamedate:[[%PAGE%|%TITLE%]]:summary:charlist table=id="logtable" class="sortable wikitable",-,IC Date,Title,Summary,Participants tablerow=width="8%" class="gamedate"¦%%,width="22%" class="title"¦%%,width="45%" class="summary"¦%%,width="25%" class="charlist"¦%%,¦%% </dpl>
So if you are playing a character named Henry Flynn, you'd replace Page Name with Henry Flynn and it would grab any logs that link to your page via internal links.
You can also add sort options by adjusting the tablerow; jut use the same code, changing the class entry or adding a new one, to any other section from your Log template. If your template is named like, Template:RP_Log, change {Log} in the include to whatever your template name is, after the :.
Hope this helps some people out.
-
Using properties with the Semantic Mediawiki extension also makes this really simple.