BaltoCo:Extensions
From BaltoCo
Contents |
[edit] MediaWiki Extensions
- http://www.mediawiki.org/wiki/Category:Extensions
- http://www.mediawiki.org/wiki/Extension_Matrix
- http://www.mediawiki.org/wiki/Manual:Contents
[edit] EmbedVideo
[edit] Usage
The EmbedVideo parser function expects to be called in either of the following ways:
- {{#ev:service|id}} -or-
- {{#ev:service|id|width}}
Where:
- service is the name of a video sharing service.
- id is the id of the video to include
- width (optional) is the width in pixels of the viewing area (height will be determined automatically)
For example, to include the famous "evolution of dance" YouTube video, you'd enter:
{{#ev:youtube|dMH0bHeiRNg}}
And if you wanted scaled down to thumbnail size, you could use:
{{#ev:youtube|dMH0bHeiRNg|100}}
Note: See the Project Homepage for more examples.
[edit] Supported Services
As of version 0.1, EmbedVideo supports embedding video content from the following services:
[edit] Flickr
Usage is basically as follows:
<flickr>{photoid}|{type}|{location}|{size}|{caption}</flickr>
Where :
{photoid} is the Flickr photo ID. This is the only compulsory parameter. All others are optional and will be detected automatically. Anything which isn't detected as on another parameter will be classified as part of the caption.
{type} is the image type as per this page (so 'thumb' / 'thumbnail' or 'frame' or nothing). Defaults to nothing.
{location} is the location as per this page (so 'right', 'left', 'center' or 'none'). Defaults to 'right'.
{size} is the size as per this page. Defaults to medium.
and {caption} is an image title. If left blank or not set then defaults to title of image from Flickr.
- See extended syntax: http://wiki.edsimpson.co.uk/index.php/Extended_Flickr_Extension_Synax
[edit] 01/31/08 - ToggleDisplay
[edit] Abstract
This extension allows to show and hide regions on a page by clicking on a link.
[edit] Usage
The simplest usage is:
<toggledisplay> hidable text </toggledisplay>
What you will see is a link "[show details]" in small font and nothing else. When you click on the link, the hidable text will be shown and the link text changes to "[hide details]". When you click again, you return to the initial state.
The following optional parameters can be provided in the < T O G G L E D I S P L A Y > tag:
| Parameter | Default | Explanation |
|---|---|---|
| state | hide | Initial state when the page is first displayed. May be hide or show. |
| showtext | [show details] | Link text when hidable area is hidden. |
| hidetext | [hide details] | Link text when hidable area is shown. |
| linkstyle | font-size:smaller | CSS style specification for the link. |
To change the defaults, you can redefine ExtToggleDisplay::$mDefaultArgs in your LocalSettings.php.
[edit] 01/31/08 - SecureHTML
[edit] Motivation for the {{ #html}} parser function
It is sometimes useful to include, in a secure fashion, a template containing 'raw html' in another page. This enables, for example, the construction of gadgets.
Through the added functionality of parameterization using the {@{parameter_here}@}, the said templates can be customized on a per-page basis without resorting to convoluted escape patterns (e.g. </html>{{{parameter_here}}}<html>) which renders page viewing difficult to humans.
[edit] Usage
[edit] < html> tag
- Use the standard <html> tags (see Manual:$wgRawHtml) within a protected page. One can either protect the page before or after the inclusion of the said tag(s).
[edit] {{ #html}} parser function
Use: SecureHTML: Permission error where:
-
page_nameis the page name of the article to include -
optional parametersare of the form:-
param_x = value_x | param_y = value_y
-
The page where this parser function is used must be edit protected.
[edit] {{ #shtml }} parser function
Same usage as for #html with difference that the origin page where this parser function is used does not need to be edit protected. The target page's edit protection attribute ensures security.
[edit] Example
[edit] Test Page
[edit] Template:Page1
This parameter will be replaced when called from Test:Page >> {@{param1}@}
| |
[edit] 01/31/08 - SimpleCalendar
This is a very simple calendar extension which renders a table of all the months in the year with each day being a wiki article (see OrganicDesign:Calendar for example). Days which have nothing in them show up as a red link, clicking on it will create a new article as usual. It installs as a parser function, so the following syntax is used:
- {{#calendar:}}
When used like this with no parameters, a calendar of all twelve months will be rendered with each day pointing to an article using the date as its title.
Note: in MediaWiki version 1.6.x you need to remove the # character from the syntax.
[edit] Parameters
There are a number of parameters which allow calendars for different specific purposes.
title: The name of the article which each day in a calendar table links to is by default the date, eg 27 Jan 2008. If you want to have different calendars for different purposes, then the title parameter will preceed the names with a separating slash character, for example, setting title to "Harry" will cause the dates to format as Harry/27 Jan 2008.
year: This changes the year of the calendar table, the default if no year is specified is the current year.
month: If a month is supplied, then only a single month will be rendered instead of a table containing all twelve months.
query: This allows extra query-string information to be appended to the links for days which don't exist. The main use for this would be to allow some preloaded content in the newly created calendar articles. See examples below - the syntax looks a little strange because it has two equals characters in it.
format: The default date format for date-articles linked to from the days in the calendar tables is, eg. 2 February 1972, but can be adjusted by supplying a PHP date format in the format parameter. See PHP-Manual/strftime for details about how to specify a date format.
dayformat: This sets the format of the titles of each day of the week at the top of the month tables. The default setting is M T W T F S S, but can be set to %a for abbreviated names in the current language such as Mon Tue..., or %A for full names in the current language.
| |
[edit] Examples
Note: the examples above use the CURRENTUSER variable which is not installed by default. See Extension:Variables if you're interested in adding variables.
- {{#calendar: title={{CURRENTUSER}} }}
- {{#calendar: title={{CURRENTUSER}} | year=2001 }}
- {{#calendar: year=2007 | month=jan | title={{CURRENTUSER}} }}
this example renders the May table for the current year
- {{#calendar: month=05 }}
this example uses the new query parameter to pre-load the NewDay template article into newly created dates. It looks a little confusing, but what it's saying is: add "preload=template" to the link
- {{#calendar: query=preload=Template:NewDay }}

