Laajennus:SelectTag

From mediawiki.org
This page is a translated version of the page Extension:SelectTag and the translation is 80% complete.
Other languages:
MediaWikin laajennukset-ohje
OOjs UI icon advanced-invert.svg
SelectTag
Julkaisustatus: vakaa
Toteutus Jäsennintoiminto
Kuvaus Adds customisable ‎<select> for inserting text via database fetching.
Tekijä(t) Khaled El Mansourykeskustelu
Viimeisin versio 1.0.3 (2012-08-19)
Yhteensopivuuskäytäntö Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki
Tietokantamuutokset Ei
Lisenssi GNU General Public License 3.0 tai myöhempi
Lataa
README
Esimerkki ExpressProgs TestWiki
$wgSelectTag
‎<select>
Voit kääntää SelectTag-laajennuksen mikäli se on saatavilla translatewiki.netissä

Check usage and version matrix.

The SelectTag extension that can be used for embedding any kind of text (incl. HTML) into a wiki page via a new tag ‎<select> tag. It selects the data to be displayed from a database table in the same database as MediaWiki is installed in.

It is fully customisable via the LocalSettings.php file to include as many attributes as needed.

Asennus

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

Määritys

LocalSettings.php

$wgSelectTag[ 'examplesource' ][ '_dbname' ] = 'exampletbl';
$wgSelectTag[ 'examplesource' ][ 'attr1' ] = 'field1';
$wgSelectTag[ 'examplesource' ][ 'attr2' ] = 'field2';
$wgSelectTag[ 'examplesource' ][ 'attr3' ] = 'field3';
$wgSelectTag[ 'examplesource' ][ '_show' ][ 'show1' ] = 'field4';
$wgSelectTag[ 'examplesource' ][ '_showDefault' ] = 'show1';

Page

<select _source="examplesource" arr1="value1" arr2="value2" arr3="value3" _show="show1" />

Resulting SQL query

SELECT field1, field2, field3 FROM exampletbl
WHERE arr1='value1' AND arr2='value2' AND arr3='value3';

Katso myös