Extension:PageBy

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
PageBy

Release status: beta

Implementation Tag
Description shows contributors inline on a wiki page
Author(s) Duesentrieb
MediaWiki >=1.9
License No license specified
Download Download snapshot

Subversion [Help]
Browse source code
README
log

The PageBy extension provides a custom tag, <pageby>, that renders as a summary of the pages edit history. It may be useful to provide a quick overview of who contributed to a page, especially on site with editorial nature, like news reports, blogs, etc.


The <pageby> tag shows up to three lines of information:

  • page creation (not shown if creation="false" is given)
  • contributor summary (lists all editors with the number of edits they made; not shown if there is only one eligible editor)
  • last edit (not shown if there is only one edit - unless page creation is not being shown)

Contents

[edit] Installing

Copy the PageBy directory into the extensions folder of your MediaWiki installation. Then add the following line to your LocalSettings.php file (near the end):

require_once( "$IP/extensions/PageBy/PageBy.php" );

[edit] Usage

To get a short summary of the edit history:

   <pageby/>;

You can provide options to controll the summary - for example, include minor edits and hide edit comments:

   <pageby nominor="false" comments="false"/>;

You can also specify another page than the one that contains the pageby tag:

   <pageby>Foo</pageby>;

Note that using the pageby tag for *another* page will disable the parser cache for the page the tag is used on. So perhaps don't do that on the main page.

For a full list of options, see below.

[edit] Options

The following options (tag attributes) can be used to controll the output of the <pageby> tags:

nominor
ignore minor edits ("true" or "false", default is "true"). Applies only to to the contributors summary, does not effect creation or last-edit line.
nobot
hide bots ("true" or "false", default is "true"). Applies only to to the contributors summary, does not effect creation or last-edit line.
noanon
hide anonymous users ("true" or "false", default is "false"). Applies only to to the contributors summary, does not effect creation or last-edit line.
comments
show edit comments ("true" or "false", default is "true").
creation
mention page creation ("true" or "false", default is "true").
time
show exact time in addition to the date ("true" or "false", default is "false").

[edit] Styling

The HTML generated by a <pageby> tag is a plain <ul>-list, but it assigns different CSS classes to the individual elements, so you can style it conveniently.

CSS classes used:

pageby
used on the <ul>-tag that contains all output
pageby-contribs
for the <li>-tag for the contribution summary
pageby-last
for the <li>-tag for the latest edit
pageby-contributor
for the <span>-tag of each contributor
pageby-comment
for the <span>-tag containing the edit comment

An example CSS style to put into MediaWiki:Common.css or a similar place:

  ul.pageby {
    float:right;
    clear:right;
    border:1px solid #60606F;
    background-color:#E0E0EF;
    font-size: 80%;
    margin:1ex;
    padding:1ex;
    list-style-type:none;
  }
Personal tools