Extension:InputBox

This page is a translated version of the page Extension:InputBox and the translation is 80% complete.
Outdated translations are marked like this.
この拡張機能は MediaWiki 1.21 以降に同梱されています。 そのため再度ダウンロードする必要はありません。 しかし、提供されているその他の手順に従う必要はあります。
MediaWiki 拡張機能マニュアル
InputBox
リリースの状態: 安定
実装 タグ , ページの操作 , 検索
説明 あらかじめ定義された HTML フォームを利用者がウィキページに追加できるようにする
作者
  • Erik Möller
  • Leonardo Pimenta
  • Rob Church
  • Trevor Parscal
  • Daniel Schuba
最新バージョン Continuous updates
MediaWiki >= 1.42
データベースの変更 いいえ
ライセンス MIT ライセンス
ダウンロード
  • <inputbox>
Quarterly downloads 288 (Ranked 23rd)
Public wikis using 10,897 (Ranked 10th)
translatewiki.net で翻訳を利用できる場合は、InputBox 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

InputBox 拡張機能はあらかじめ作られた HTML フォームをウィキページに追加します。 利用者はボックスにテキストを入力することによってフォームを「埋める」(テキストを入力する、メニュー項目を選択する、等)ことができます。

InputBoxは、当初は Erik Möller によって Wikinews の「記事を作成する」欄を追加するために作成されました。

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のInputBoxという名前のディレクトリ内に配置します。
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/InputBox
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'InputBox' );
    
  •   完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

新しい記事を開始するためのボックス。

ウィキコード

<inputbox>
type=create
width=30
break=no
</inputbox>

結果

一般的な構文

入力ボックスは以下のように構築されます:

<inputbox>
type=
bgcolor=
width=
page=
default=
preload=
editintro=
buttonlabel=
hidden=
searchbuttonlabel=
fulltextbutton=
labeltext=
break=
namespaces=
prefix=
placeholder=
minor=
nosummary=
summary=
id=
inline=
dir=
preloadparams[]=
searchfilter=
useve=
usedt=
arialabel=
</inputbox>

type パラメーターは必須です。 その他のパラメーターはすべて省略可能です。 preloadparams[]は複数回現れます。

ボックスの種類

既定では、「送信」ボタンは入力ボックスの下に配置されます。

「送信」ボタンは、break=noというパラメータを指定することで入力ボックスの右に配置させることも可能です。このパラメーターは、ボックスとボタンの間にある改行を取り除くものです: break=no

「送信」ボタンを下に配置すると入力の自動補完機能によってボタンが隠れてしまうといった場合には右に配置するのが有用です。

種類 説明
search
既定の幅が50文字の検索ボックスを作成します。 テキストボックスに追加された情報が検索されます。
create

新しいページを作成します。 テキストボックスに追加される情報は、編集されたページの名前です。
comment

テキストボックスに指定のあるとおり、ページの末尾に新しく節を追加します。
commenttitle

テキストボックスに入力した文字例を見出しに使い、新しい節を作ります。 タイトルは、default=パラメータで指定します。ページは、page=パラメータで指定する必要があります。 For some reason this does NOT work when using the extension by invoking it with {{#tag}}, only when using ‎<inputbox>. (rev:47203 で導入)
fulltext
表示ボタンを使わずに、全文検索ボタンのみで検索します。 (rev:45269 で導入)
move

ページ名を別の名前に移動する。 This also doesn't work when creating it by invoking a tag. (gerrit:97559 で導入)

type=search2 の場合、検索ボタンの既定の位置は右側でインラインです。 現在のところ、このタイプの入力ボックスに他のパラメータを追加することはできないようです。 この検索ボックスは、それが置かれたWiki全体を検索します。

種類
search2
 

パラメーター

パラメーター 説明 通用範囲 互換性 結果
arialabel= Supply the aria-label attribute to the inputbox to allow generated markup be accessible to screen readers すべての種類
1.35
Gerrit change 572050
<inputbox>
type=search
arialabel=Search the Wiki
</inputbox>
bgcolor= テーブルの背景色を設定します(HTMLカラー値)。 引用符は使用しないでください。 すべての種類 ?
<inputbox>
type=search
bgcolor=#eeeeff
</inputbox>
width= InputBoxの幅を文字数で設定します。 すべての種類 ?
<inputbox>
type=create
width=24
</inputbox>

default= InputBoxに入れるデフォルトのテキスト。 すべての種類 ?
<inputbox>
type=comment
default=User talk:Eloquence
</inputbox>

preload= 新しいページを作成すると、このタイトルのページが空白の編集ボックスにあらかじめ読み込まれます(Manual:テキストをプリロードしてページを作る 参照)。 create, comment, commenttitle ?
<inputbox>
type=create
preload=Log
</inputbox>

上または下の例のInputBoxに存在しないページのタイトルを入力し、それぞれ「項目を作成」または「新しい節」をクリックして、この効果を試してみてください。
editintro= このパラメータで指定されたページは、編集ウィンドウのに指示として表示されます。 create, comment ?
<inputbox>
type=comment
editintro=MediaWiki:Missingcommenttext
</inputbox>

buttonlabel= このラベルは、フォームのメインボタンに使用されます。 すべての種類 ?
<inputbox>
type=comment
buttonlabel=新しいリソースを追加
</inputbox>

hidden= InputBoxが存在しないことを指定します。

パラメーター default と共に使用され、現在は既定ではなく、ページ名の固定値となっています。 Any value means yes/true.

create, comment ?
<inputbox>
type=comment
editintro=Extension:InputBox/editintro comment
preload=Extension:InputBox/preload
hidden=yes
default=Extension talk:InputBox
buttonlabel=トークページ上にコメントを投稿する
</inputbox>

searchbuttonlabel= このラベルは、フォームのメインボタンに使用されます。 search, fulltext ?
<inputbox>
type=search
searchbuttonlabel=深堀りする
</inputbox>
fulltextbutton= Show the full text search button on search2 form search2 ?
<inputbox>
type=search2
searchbuttonlabel=深堀りする
fulltextbutton=true
</inputbox>
labeltext= ボタンの横に印刷するテキスト search2 ?
<inputbox>
type=search2
searchbuttonlabel=深堀りする
labeltext=検索 
</inputbox>
 
break= 入力ボックスとボタン(複数可)の間に改行を挿入するかどうか。 デフォルトはyes(改行を使用)。 すべての種類 ?
<inputbox>
type=create
width=24
break=no
</inputbox>
namespaces= 全文検索で名前空間チェックボックスに対応

"Main**"を指定すると、デフォルトで主記事の名前空間がチェックされます。

search, fulltext ?
<inputbox>
type=search
namespaces=Main**,Help
</inputbox>
prefix=
  • 特定の接頭辞で始まるページに絞り込むことができます。 これは特定の検索バックエンドでのみ動作することに注意しましょう。現在は Extension:CirrusSearch のみです。 デフォルトでは空文字列(全ページ検索)です。
  • 特定の接頭辞で始まる新しいページを作成します。
  • type=moveでは、デフォルトのパラメータに接頭辞が付きます。

注:アンダースコアはスペースとして認識されません。

search, fulltext, create ?
<inputbox>
type=search
prefix={{FULLPAGENAME}}/Archive
</inputbox>

下のボタンは、名前の前にSpecial:Mypage/を付けています。


placeholder= 入力ボックスが空のときに表示されるプレースホルダーテキストを定義します。 すべての種類
1.19
<inputbox>
type=search
placeholder=このウィキ内を検索
</inputbox>
page= コメントを投稿するページ、または移動するページ。 comment, move
<inputbox>
type=comment
page=Project:Sandbox
</inputbox>

minor= 細部の編集。 comment, create
<inputbox>
type=comment
page=Project:Sandbox
minor=true
</inputbox>

nosummary= 新しいコメントには、編集の概要(見出し)は必要ありません。 comment
<inputbox>
type=commenttitle
page=Special:Mypage/inputbox test
nosummary=true
</inputbox>

summary= 要約か移動理由 create, move
<inputbox>
type=create
default=Special:Mypage/inputbox test
summary=Foo
</inputbox>

id= <form>のためにID属性を指定します。 すべての種類
1.23
for some types
<inputbox>
type=comment
page=Project:Sandbox
summary=Foo
id=bar
</inputbox>

inline= InputBoxをインライン要素にする(冒頭で改行しない)。 Any value means yes/true. search2
文字を入力: <inputbox>
type=search2
inline=true
width=10
</inputbox>
文字を入力:
 
dir= 右から左(rtl)または左から右(ltr)。 デフォルトは、ページの言語の方向性。 すべての種類
<inputbox>
dir=rtl
type=comment
page=Project:Sandbox
summary=Foo
</inputbox>

preloadparams[]= プリロードテキストへのパラメータを指定する。 プリロードされたテキストでページを作成を参照してください。 create, comment, commenttitle
1.25
<inputbox>
type=create
preload=Log
preloadparams[]=param1
preloadparams[]=param2
</inputbox>

searchfilter= 検索に付加するパラメータを指定する search
1.30
<inputbox>
type=search
searchfilter=insource:foo
</inputbox>
useve= When creating a page the input box will use the new visual editor, if the extension is installed, and this parameter is set to any value. create, comment
<inputbox>
type=create
break=no
useve=true
</inputbox>
usedt= When adding a new section, the input box will open the DiscussionTools new topic tool, if the extension is installed, and this parameter is set to any value. comment, commenttitle
<inputbox>
type=commenttitle
page=Project:Sandbox
usedt=true
</inputbox>

Applying create to an existing page simply gives the edit page. In that case preload is ignored. Applying comment for a new page works.

The texts taken from the MediaWiki: namespace are of course only examples, any existing page can be used for editintro or preload. Unfortunately preload does not yet work for the Upload summary.

配置

If you want to create an inputbox on the right side of the page, do something like:

<div style="float:right; width:42em">
<inputbox>
type=create
</inputbox>
</div>

Gives:


パーサー関数

Using InputBox in a template

In order to create many similar input boxes, InputBox can be used in a template. However, passing template parameters to InputBox parameters only works if the ‎<inputbox>...‎</inputbox> tag is written as {{#tag:inputbox | ...}} inside the template.

The following example is a template to create a new wiki page from a named template:

{{#tag:inputbox |
type=create
buttonlabel=Create new {{{1|article}}}
preload={{{2|Template:Article}}} }}

When instantiating the template, the first parameter gives the item that is created (default: article) as spelled out in the button, the second parameter gives the name of the template used to create the item (default: Template:Article).

E.g., the code for an input box to create a new project from a project template might look like this:

{{Template:CreateNew|project|Template:Project}}

関連項目