Extension:UrlGetParameters

This page is a translated version of the page Extension:UrlGetParameters and the translation is 27% complete.
MediaWiki 拡張機能マニュアル
UrlGetParameters
リリースの状態: 安定
実装 パーサー関数
説明 Provides a parser function {{#urlget:...}} which allows access to the URL parameters in your page.
作者 S.O.E. Ansems
最新バージョン 1.6.0 (2021-04-16)
MediaWiki 1.35+
データベースの変更 いいえ
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
  • $wgUrlGetParametersSeparator
Quarterly downloads 17 (Ranked 130th)
translatewiki.net で翻訳を利用できる場合は、UrlGetParameters 拡張機能の翻訳にご協力ください
Vagrant role urlgetparameters

The UrlGetParameters extension enables you to use and/or display the "GET" parameters of the URL, i.e. the query string, on the wiki page.

インストール

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

使用法

Caching for the page you use this extension on should be disabled.

To display the value of a URL get parameter in your page, you might do this:

{{#urlget:parameter-name}}

Where parameter-name is the name of the parameter whose value you want. If the parameter is not found, the extension will result in nothing. Alternatively, you can also specify a default value as follows:

{{#urlget:parameter-name|default-value}}

When the parameter parameter-name is not available, then the value default-value is returned.

If the URL contains parameters of the form "A[B]=C", you can display the value "C" in a similar way, by calling:

{{#urlget:A[B]}}

作者

This extension was written by S.O.E. Ansems. Important contributions were made by Ankit Garg and some anonymous editors.