Open main menu

Extension:Did You Know

shortcut: DYK
MediaWiki extensions manual
OOjs UI icon advanced.svg
Did You Know
Release status: experimental
Description Adds display() function that displays an "Did You Know?" box for a random article in the category.
Author(s) Jeroen De Dauw
MediaWiki 1.28.0+
PHP 5.2+
Database changes No
License GNU General Public License 2.0 or later
Download
readme
release notes
Translate the Did You Know extension if it is available at translatewiki.net
Check usage and version matrix.
Issues Open tasks · Report a bug

This extension allows for displaying a "did you know" box in articles (using some wikitext construct) and other interfaces such as special pages (by using the PHP interface from another extension).

The did you know (DYK) box consists of a header "Did you know... ?", followed by content pulled from a wiki page. The wiki page gets randomly selected from a list of pages within a certain category (this category can be configured in LocalSettings). A "type" parameter can also be provided, which causes the lookup for the page to happen in a different category, for example [[Category:Did you know/$type]], where $type gets replaced by the value of the type parameter. If there are no pages in this category, the selection mechanism falls back to the default category.

Contents

RequirementsEdit

Did You Know requires:

DownloadEdit

The extension can be retrieved directly from Git [?]:

  • Browse code
  • Some extensions have tags for stable releases.
  • Each branch is associated with a past MediaWiki release. There is also a "master" branch containing the latest alpha version (might require an alpha version of MediaWiki).

Extract the snapshot and place it in the extensions/DidYouKnow/ directory of your MediaWiki installation.

If you are familiar with git and have shell access to your server, you can also obtain the extension as follows:

cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/DidYouKnow.git

InstallationEdit

  • Download and place the file(s) in a directory called DidYouKnow in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/DidYouKnow/DidYouKnow.php";
    
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

UsageEdit

...

VersionEdit

This is a copy of the release notes file on Git, which might be more up to date then this page.

...

InternationalizationEdit

Did You Know is fully internationalized. Translation of Did You Know messages is done through translatewiki.net. The translation for this extension can be found here. To add language values or change existing ones, you should create an account on translatewiki.net, then request permission from the administrators to translate a certain language or languages on this page (this is a very simple process). Once you have permission for a given language, you can log in and add or edit whatever messages you want to in that language.

ScreenshotsEdit

See alsoEdit

External linksEdit