Extension:Semantic Image Input
Semantic Image Input Release status: beta |
|
---|---|
![]() |
|
Implementation | Special page, Ajax, User interface |
Description | Semantic Image Input allows for automatic adding of images from Wikipedia pages |
Author(s) | Jeroen De Dauw |
Last version | 0.1 (2011-11-10) |
MediaWiki | 1.17.0 or higher |
PHP | 5.3 or above |
Database changes | no |
License | GNU GPL v3+ |
Download | |
Check usage (experimental) |
Contents |
[edit] About
Semantic Image Input allows for automatic adding of images from Wikipedia pages via a Semantic Forms input.
[edit] Feature overview
- Image input that automatically fetches the first image from a Wikipedia page.
- Wikipedia redirect resolving.
- Support for multiple instance templates in forms.
[edit] Requirements
Semantic Image Input requires:
- MediaWiki 1.17 or above
- Semantic Forms 2.2 or above
- PHP 5.3 or above
[edit] Download
You can find the current version of Semantic Image Input on the Google Code download page, as well as a list of legacy downloads.
You can get the code directly from SVN. Tags can be obtained via
svn checkout http://svn.wikimedia.org/svnroot/mediawiki/tags/extensions/SemanticImageInput/REL_version
Where 'version' is the version number of the tag, such as 0_1 (see the available tags). The latest code can be obtained from trunk:
svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SemanticImageInput/
[edit] Installation
Once you have downloaded the code, place the SemanticImageInput directory within your MediaWiki 'extensions' directory. Then add the following code to your LocalSettings.php file:
# Semantic Image Input require_once( "$IP/extensions/SemanticImageInput/SemanticImageInput.php" );
You will also need to enable instant commons for the embedding of images to work. This can be done with:
# Enable instant commons $wgUseInstantCommons = true;
Beware that in recently installed MediaWikis, this setting might already be present, in which case you should make sure it's set to true instead of adding another copy.
[edit] Configuration
Configuration of Semantic Image Input is done by assigning to $egSIISettings in your LocalSettings.php file. The options are listed below and their default is set in the Semantic Image Input settings file. You should NOT modify the settings file, but can have a look at it to get an idea of how to use the settings, in case the below descriptions do not suffice.
Example of how to change a setting:
$egSIISettings['defaultWidth'] = 250;
Available settings:
Name | Type | Default | Description |
---|---|---|---|
defaultImage | string | File:Mail-envelope.png | The default image to add in case no image could be obtained. |
defaultWidth | integer | 200 | The default |
[edit] Usage
The input added by this extension is called "instantimage" and it has 2 modes, which can be chosen using the "type" parameter.
[edit] Page mode
In page mode, the input will pull an image from the Wikipedia page with the same name as the page being edited or created.
{{{field|Image|mandatory|input type=instantimage|type=page}}}
[edit] Item mode
Item mode is for in multiple instance templates. The input will find the first input in the multiple instance template, and on every change of the value in this input, look up a corresponding image.
{{{field|Image|mandatory|input type=instantimage|type=item}}}
[edit] Form example
Example of a form with an input in page mode and one in item mode:
{{{for template|Book}}} '''Description:''' {{{field|Description|input type=text}}} '''Image:''' {{{field|Image|mandatory|input type=instantimage|type=page}}} {{{end template}}} == Authors == {{{for template|Book author|label=Author|multiple}}} '''Name:''' {{{field|Name|input type=text}}} '''Image:''' {{{field|Image|input type=instantimage|type=item}}} {{{end template}}}
[edit] No image shows
When there is no matching Wikipedia article, or the matching article has no images, no image will be shown. Furthermore, only images under open licences that can be found on Wikimedia Commons will be shown. In case the first image of a Wikipedia article is not under such a licence, but used under fair usage policy, it will not be shown.
[edit] Version
This is a copy of the release notes file on SVN, which might be more up to date then this page.
[edit] Version 0.1
2011-11-10
- Image input that automatically fetches the first image from a Wikipedia page.
- Wikipedia redirect resolving.
- Support for multiple instance templates in forms.
[edit] Internationalization
Semantic Image Input is fully internationalized. Translation of Semantic Image Input 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.
[edit] Authors
Semantic Image Input has been written by Jeroen De Dauw.