Help:Forum
Overleg5op deze wiki
See also
Forum is a Mediawiki extension. It provides more versatile listings of pages in categories.
Inhoud |
Additions to DPL
Features added to DynamicPageList:
- addlastedit=true (Displays the time each page was last edited. If mode=table, this will be placed in its own cell.)
- addlasteditor=true (Displays the last editor of the page. If mode=table, this will be placed in its own cell.)
- cache=false (Disables the page cache for dynamic results.)
- historylink=true (Links the date of the last edit to the page history.)
- mode=table (Produces table html to have each list item is in its own row, except the <table> tags, so multiple instances can be in the same table; the forum elements have to be put inside a HTML table element)
- newdays={number} (Marks all pages edited less than {number} days ago with class="forum_new".)
- ordermethod=pageid (Orders by the page id, so the most recently created topics are on top.)
- start={number} (Starts at the {n+1}th topic of the forum, so large forums can occupy multiple pages.)
- timestamp=true (Adds a timestamp to the end of each URL, so newly edited versions won't show up in the browser history.)
- title={string} (Sets the page link as the given title, and sets count=1. Used for linking to subforums.)
- Support for URL arguments when caching is disabled:
- offset=X (adjusts start by X)
Changed defaults:
- addlastedit=true
- cache=false
- mode=table
- newdays=7
- ordermethod=lastedit
- timestamp=true
Using Forum
Use the following XML-like syntax on your wiki page:
<Forum> ...parameters... </Forum>
The output of this would be something like:
where the list of pages being output, as well as the order and display mode of the list are set by the parameters specified.
The following lists parameters and their effects
Page selection
category
Purpose:
DPL produces a list of all pages in the intersection of the specified categories (the pages which are in all of the listed categories).
Syntax:
category=category name
Example:
<Forum> category=Demo category=Demo 1 mode=ordered </Forum>
gives
This list will output pages that are in both Category:Demo and Category:Demo 1.
Notes:
At least one category parameter is required. There is a maximum number of category parameters allowed by the extension, configurable at installation time (see top of the extension file). You may use magic words like {{CURRENTMONTHNAME}}, {{CURRENTDAY}}, {{CURRENTYEAR}} etc in the category name.
notcategory
Purpose:
Restricts the list of pages specified above to those not in a particular category.
Syntax:
notcategory=category name
Example:
<Forum> category=Demo notcategory=Demo 1 mode=ordered </Forum>
gives
(list of pages that are in Category:Demo but not in Category:Demo 1).
Notes: You may use magic words like {{CURRENTMONTHNAME}}, {{CURRENTDAY}}, {{CURRENTYEAR}} etc in the category name.
namespace
Purpose:
Restricts the list of pages specified above to those in a particular namespace.
Syntax:
namespace=namespaceid or name
The namespaceid may be any positive integer or zero, assuming it represents a valid namespace in the system. The zero namespace is the main article namespace.
Instead of the number, you may also specify a name, for example Talk or Template or User_talk. Any invalid name is equivalent to the main article namespace.
Example:
<Forum> category=Demo namespace=Help mode=ordered </Forum>
gives
(list of pages that are in the Help namespace and belong to Category:Demo).
redirects
Purpose:
Controls the inclusion or exclusion of redirect pages in lists.
Format:
redirects=criteria
criteria can be one of:
- exclude — excludes redirect pages from lists — (default)
- include — allows redirect pages to appear in lists
- only — lists only redirect pages in lists
Example:
<Forum> category=Demo redirects=only mode=ordered </Forum>
gives
(list of redirect pages in Category:Demo).
count
Purpose:
Restricts the number of results that are shown.
Format:
count=number of results
Example:
<Forum> category=Demo count=2 mode=ordered </Forum>
gives
(list of the two most recent pages in Category:Demo).
Notes:
There is a maximum allowed number of results, controlled by a setting in the extension.
title
Example:
<Forum> category=Demo title=abc historylink=true addlasteditor=true mode=ordered </Forum>
gives
Provides a link to abc, the time of last edit of any page in Category:Demo (including subcategory pages themselves, but not including pages in its subcategories), linked to the history of abc, and the linked name of the user who made the edit.
Typical use is with, instead of abc, a pagename such as Forum:Demo, where that page contains a forum element regarding the pages in the category Demo. See e.g. http://www.wikia.com/wiki/Forum:Index .
Details displayed
shownamespace
Purpose:
Specify whether to display the namespace names of the pages (default=true).
Example:
<Forum> category=Demo shownamespace=false mode=ordered </Forum>
gives
addfirstcategorydate
- (Seems to be defective, for the day of the month it gives "< >".)
Purpose:
Shows the date the article got added to the first listed include category. The linked page names are prepended with "DD Month YYYY: " (formatted according to your local mediawiki date display preferences).
Example:
addfirstcategorydate=true
If omitted, the default is false.
Example:
<Forum> category=Demo addfirstcategorydate=true mode=ordered </Forum>
gives
historylink
- historylink=true (date links to history)
- historylink=false (default)
<Forum> category=Demo historylink=true mode=ordered </Forum>
gives
<Forum> category=Demo historylink=false mode=ordered </Forum>
gives
Note that some Wikia have a page Common.css with code to make the link invisible:
.forumlist td.forum_edited a { color: black; text-decoration: none }
This can be overridden by e.g.:
.forumlist td.forum_edited a { color: red; text-decoration: underline !important}
addlasteditor
<table> <Forum> category=Demo historylink=true addlasteditor=true </Forum> </table>
gives
| Peize:Demo 2 | 18 aug 2006 09:45 | Pat |
| Peize:Demo 1 | 17 aug 2006 13:53 | Pat |
| Categorie:Demo 1 | 17 aug 2006 13:11 | Pat |
mode
Purpose:
To control the output of the DPL: with bullets, numbers, or nothing in front.
Syntax:
mode=modename
modename can be one of:
- unordered — outputs an unordered list — HTML tag "ul" —
- ordered — outputs an ordered list — HTML tag "ol"
- none — outputs a list using newlines and HTML tags "br" to separate each item
- table (default)
Examples:
<Forum> category=Demo mode=unordered </Forum>
gives
<Forum> category=Demo mode=none </Forum>
gives
Peize:Demo 2 - Laatste bewerking 18 aug 2006 09:45
Peize:Demo 1 - Laatste bewerking 17 aug 2006 13:53
Categorie:Demo 1 - Laatste bewerking 17 aug 2006 13:11
<table> <Forum> category=Demo </Forum> </table>
gives
| Peize:Demo 2 | 18 aug 2006 09:45 |
| Peize:Demo 1 | 17 aug 2006 13:53 |
| Categorie:Demo 1 | 17 aug 2006 13:11 |
newdays
Assigns class="forum_new" to the linked pagename, if the page has been edited in the last specified number of days.
<Forum> category=Demo historylink=true newdays=1 mode=ordered </Forum>
gives
suppresserrors
Does not seem to work.
<Forum> category=Dem suppresserrors=false mode=ordered </Forum>
gives
<Forum> category=Dem suppresserrors=true mode=ordered </Forum>
gives
Order
ordermethod
Purpose:
Determines what date is used for ordering the list.
Format:
ordermethod=method
method can be one of:
- categoryadd — outputs list based on most recent addition to the first category — (default)
- lastedit — outputs list based on most recent edit to the pages
Examples:
<Forum> category=Demo addfirstcategorydate=true historylink=true newdays=1 mode=ordered ordermethod=categoryadd </Forum>
gives
(shows pages most recently added to the category at the top).
<Forum> category=Demo addfirstcategorydate=true historylink=true newdays=1 mode=ordered ordermethod=lastedit </Forum>
gives
(shows most recently edited pages at the top).
<Forum> category=Demo addfirstcategorydate=true historylink=true newdays=1 mode=ordered ordermethod=pageid </Forum>
gives
(shows most recently created pages at the top).
Compare related changes , which shows the same order, but gives all edits instead of only the last, but, on the other hand, currently on this project restricted to edits of the last month. It also gives other info for each entry.
order
Purpose:
Controls the sort direction of the list.
Example:
order=orderdirection
orderdirection can be one of:
- descending — outputs list from most recent to least recent — (default)
- ascending — outputs list from least recent to most recent
<Forum> category=Demo mode=ordered ordermethod=lastedit order=ascending </Forum>
gives