VirtualMV/Digital Learning Technologies/Extending wikis and blogs/MediaWiki
Digital Learning Technologies | ||
---|---|---|
Extending wikis and blogs | MediaWiki | WordPress | Blogger |
Overview
Media wiki can be extended in several ways
- Client-Side JavaScript
- Templates
- Extensions
- Widgets
- Miscellaneous Tools
The MediaWiki codebase contains various "hooks" using callback functions to add additional code in an extensible way. This allows developers to write extensions without modifying the core or having to submit their code for review. Installing an extension typically consists of adding a line to the configuration file, though in some cases additional changes such as database updates are required. Wikipedia:MediaWiki(2009)[1]
JavaScript
Media wiki allows a special page MediaWiki:Common.js that is loaded every time a page is displayed. It is not editible by users and is created by the system admin.
JavaScript inpage
In here I'd love to include a basic javascript that demonstrates how it can be included on a web page, something like..
<script type="text/javascript"> function fnHello() { alert("HELLO"); } </script> <form> <input type="button" onclick="fnHello()" value="Call function" /> </form>
Reference: wikibooks:MediaWiki Developer's Handbook/Add JavaScript (2009)[2] - really cryptic and really no help at all yet :)
However Media wiki describes an extension (Extension:Javascript, 2009, June 27)[3] which I must try (I want to add a text size JavaScript element).
Extensions
Extensions are added by the system administrator and the functionality is then added to the wiki. As at March 2012 there were approximately 2,000 extensions and documentation for Mediawiki includes an Extension Matrix and a table describing the extensions.
Adding an extension
To add an extension usually requires that you
- Find the extension you want, (e.g. Geshi - a Syntax highlight text snippets, whole pages or whole files).
- Read the Installation instructions which usually follows
- Download the code (usually in a compressed archive) and decompress if necessary. This will be in a folder (e.g. SyntaxHighlight_GeSHi )
- Upload (FTP) this folder to the Extensions Folder on your web server.
- Add the hook into the LocalSettings.php file in the wiki folder, ( e.g. require_once( "$IP/extensions/geshi/geshi.php" ); )
This is then activated by adding the following into the wiki
<source lang="javascript">
/*Code in here e.g. Javascript
/*More code
</source>
/*Code in here e.g. Javascript
/*More code
Depending on the browser, the code appears in a very small font (I have modified this using a template for vMVwiki to add a box border around as well.
The cite extension
The cite extension creates a linked page that produces a variety of referencing styles for your page. An extra option is added to the toolbox (in the left panel) called cite this page. If you click on this link a page showing a variety of referencing styles is displayed for the page.
In the wiki you can have the reference appear at the bottom of the page using the <ref> tag. There is an example of implementing an APA style citation/Reference at DLT Overview, Teaching.
Templates
In wiki syntax, a template is identified by a page surrounded by curly brackets ({{ ... }}). There is a template language that allows you to build a page which you can pass variable to. Examples of template pages are:
- a box template to create the pedagogical boxes (called instructional Devices (iDevices) in WikiEducator ) - like activities
- a Footer template which also generates an APA style reference is shown below:
==References== <references /> <p> </p> <div style="font-family: menu,Arial; border: 1px solid #0000FF;font-size: x-small; background-color: #E6F2FF;"> {{{1}}} ({{CURRENTYEAR}}). ''{{PAGENAME}}''. Retrieved {{CURRENTMONTHNAME}} {{CURRENTDAY}}, {{CURRENTYEAR}}, from {{fullurl:{{PAGENAME}}}}</div>
and call it at the bottom of a wiki page using
{{Template:APAFooter|Me}}
The {{1}} allows you to pass a parameter to the template, in this case "Me" (parameters are separated by a | )
Which will produce
Me (2024). VirtualMV/Digital Learning Technologies/Extending wikis and blogs/MediaWiki. Retrieved November 21, 2024,
from https://wikieducator.org/VirtualMV/Digital_Learning_Technologies/Extending_wikis_and_blogs/MediaWiki
Pedagogical template
|
Syntax Highlighter
|
Mediawiki activity
References
- ↑ Wikipedia:MediaWiki(2009) Media Wiki: Customisation. Retrieved June 6, 2009 from http://en.wikipedia.org/wiki/MediaWiki#Customization
- ↑ wikibooks:MediaWiki Developer's Handbook/Add JavaScript (2009) MediaWiki Developer's Handbook/Add JavaScript. Retrieved June 6, 2009 from http://en.wikibooks.org/wiki/MediaWiki_Developer's_Handbook/Add_JavaScript
- ↑ Extension:Javascript. (2009, June 27). MediaWiki, The Free Wiki Engine. Retrieved 11:24, October 7, 2009 from http://www.mediawiki.org/w/index.php?title=Extension:Javascript&oldid=262504
virtualMV | Superquick wiki guide | Please give me some feedback |
VirtualMV/Digital Learning Technologies/Extending wikis and blogs/MediaWiki. (2024). In WikiEducator/VirtualMV wiki. Retrieved November 21, 2024, from http:https://wikieducator.org/VirtualMV/Digital_Learning_Technologies/Extending_wikis_and_blogs/MediaWiki (zotero)
|