Extension:SelectTag

From mediawiki.org
This page is a translated version of the page Extension:SelectTag and the translation is 57% complete.
MediaWiki 拡張機能マニュアル
SelectTag
リリースの状態: 安定
実装 パーサー関数
説明 Adds customisable ‎<select> for inserting text via database fetching.
作者 Khaled El Mansouryトーク
最新バージョン 1.2.0 (2022-11-05)
互換性の方針 MediaWiki とともにリリースされるスナップショット。 master には後方互換性がありません。
MediaWiki >= 1.35.0
データベースの変更 いいえ
ライセンス GNU 一般公衆利用許諾書 3.0 以降
ダウンロード
README
ExpressProgs TestWiki
$wgSelectTag
‎<select>
Quarterly downloads 0
translatewiki.net で翻訳を利用できる場合は、SelectTag 拡張機能の翻訳にご協力ください

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.

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のSelectTagという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/SelectTag
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'SelectTag' );
    
  • Yes 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

設定

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';

関連項目