shortcut: SII

Extension:Semantic Image Input

From Linux Web Expert

MediaWiki extensions manual
Semantic Image Input
Release status: unmaintained
File:Semanticimageinput.png
Implementation Special page , Ajax, User interface
Description Allows for automatic adding of images from Wikipedia pages
Author(s) Jeroen De Dauwtalk
Latest version 0.4.0 (2017-08-01)
MediaWiki 1.23+
PHP 5.3+
Database changes No
License GNU General Public License 3.0 or later
Download
CHANGELOG
Quarterly downloads Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Public wikis using Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Translate the Semantic Image Input extension if it is available at translatewiki.net

The Semantic Image Input extension allows for automatic adding of images from Wikipedia pages via a Semantic Forms input.

Feature overview

  • Image input that automatically fetches the first image from a Wikipedia page.
  • Wikipedia redirect resolving.
  • Support for multiple instance templates in forms.

Requirements

Semantic Image Input requires:

Download

<translate> The extension can be retrieved directly from Git</translate> [?]:

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

<translate> Extract the snapshot and place it in the <tvar name=name>extensions/SemanticImageInput/</tvar> 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: </translate>

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

Installation

  • <translate> [[<tvar name=2>Special:ExtensionDistributor/SemanticImageInput</tvar>|Download]] and move the extracted <tvar name=name>SemanticImageInput</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/SemanticImageInput
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    require_once "$IP/extensions/SemanticImageInput/SemanticImageInput.php";
    $wgUseInstantCommons = true; // Required for embedding of images
    
  • Configure as required.
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

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

Usage

The input added by this extension is called "instantimage" and it has 2 modes, which can be chosen using the "type" parameter.

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}}}

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}}}

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}}}

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.

Authors

Semantic Image Input has been written by Jeroen De Dauw for WhoInspired.

See also

External links