「テンプレート:Notice」の版間の差分
細 画像の参照先を変更 |
細 画像の参照先を変更 |
||
| 6行目: | 6行目: | ||
| style = {{#if:{{{small|}}}||{{#if:{{{section|}}}|{{Main other|width:auto;|demospace={{{demospace|}}}}}}}}} | | style = {{#if:{{{small|}}}||{{#if:{{{section|}}}|{{Main other|width:auto;|demospace={{{demospace|}}}}}}}}} | ||
| image = [[File:{{#if:{{{image|}}}|{{{image}}}|{{#switch:{{{3|{{{style}}}}}} | | image = [[File:{{#if:{{{image|}}}|{{{image}}}|{{#switch:{{{3|{{{style}}}}}} | ||
| stop = OOjs UI icon cancel-destructive.svg | | stop = OOjs UI icon cancel-destructive.svg.png | ||
| warning = OOjs UI icon error-destructive.svg | | warning = OOjs UI icon error-destructive.svg.png | ||
| question = OOjs UI icon helpNotice-ltr-progressive.svg | | question = OOjs UI icon helpNotice-ltr-progressive.svg | ||
| attention = OOjs UI icon alert- | | attention = OOjs UI icon alert destructive black-darkred.svg.png | ||
| important = | | important = Sonota_no_kiken_blinker.JPG | ||
| search = OOjs UI icon search-ltr-progressive.svg | | search = OOjs UI icon search-ltr-progressive.svg.png | ||
| fix = Icon Maintenance.svg | | fix = Icon Maintenance.svg.png | ||
| announce = Echo feedback.svg | | announce = Echo feedback.svg | ||
| help = OOjs UI icon map-ltr-progressive.svg | | help = OOjs UI icon map-ltr-progressive.svg | ||
| 20行目: | 20行目: | ||
| #default = OOjs_UI_icon_information-progressive.svg.png}}}}|40x40px|link=|alt=]] | | #default = OOjs_UI_icon_information-progressive.svg.png}}}}|40x40px|link=|alt=]] | ||
| smallimage = [[File:{{#if:{{{image|}}}|{{{image}}}|{{#switch:{{{3|{{{style}}}}}} | | smallimage = [[File:{{#if:{{{image|}}}|{{{image}}}|{{#switch:{{{3|{{{style}}}}}} | ||
| stop = OOjs UI icon cancel-destructive.svg | | stop = OOjs UI icon cancel-destructive.svg.png | ||
| warning = OOjs UI icon error-destructive.svg | | warning = OOjs UI icon error-destructive.svg.png | ||
| question = OOjs UI icon helpNotice-ltr-progressive.svg | | question = OOjs UI icon helpNotice-ltr-progressive.svg | ||
| attention = OOjs UI icon alert- | | attention = OOjs UI icon alert destructive black-darkred.svg.png | ||
| important = | | important = Sonota_no_kiken_blinker.JPG | ||
| search = OOjs UI icon search-ltr-progressive.svg | | search = OOjs UI icon search-ltr-progressive.svg.png | ||
| fix = Icon Maintenance.svg | | fix = Icon Maintenance.svg.png | ||
| announce = Echo feedback.svg | | announce = Echo feedback.svg | ||
| help = OOjs UI icon map-ltr-progressive.svg | | help = OOjs UI icon map-ltr-progressive.svg | ||
| 32行目: | 32行目: | ||
| news = OOjs UI icon newspaper-ltr-progressive.svg | | news = OOjs UI icon newspaper-ltr-progressive.svg | ||
| propose = Icons8 flat collaboration.svg | | propose = Icons8 flat collaboration.svg | ||
| #default = OOjs_UI_icon_information-progressive.svg}}}}|30x30px|link=|alt=]] | | #default = OOjs_UI_icon_information-progressive.svg.png}}}}|30x30px|link=|alt=]] | ||
| text = {{#if:{{{header|}}}|<div style="text-align:center">'''{{{header}}}'''</div>}}{{#if:{{{title|{{{2|}}}}}}|'''{{{title|{{{2}}}}}}''':}}{{{text|{{{1|}}}}}} | | text = {{#if:{{{header|}}}|<div style="text-align:center">'''{{{header}}}'''</div>}}{{#if:{{{title|{{{2|}}}}}}|'''{{{title|{{{2}}}}}}''':}}{{{text|{{{1|}}}}}} | ||
}}<noinclude> | }}<noinclude> | ||
{{Documentation}} | {{Documentation}} | ||
<!-- カテゴリと言語間リンクはここではなく、/doc サブページに追加してください --></noinclude> | <!-- カテゴリと言語間リンクはここではなく、/doc サブページに追加してください --></noinclude> | ||
2025年1月7日 (火) 02:28時点における最新版
汎用のお知らせテンプレートです。Subst: は非推奨。
使い方
任意の場所に、以下のように入力します。
{{Notice|表示したい文字列}}
| 表示したい文字列 |
このように、簡単にお知らせテンプレートを設置することができます。Template:Mboxを使用しているため、このテンプレートを記事で呼び出せばTemplate:Amboxと同様の表示が得られます。
複数のパラメータを設定して使うこともできます。
{{Notice|表示したい文字列|タイトル(題)|style=スタイル}}{{Notice|表示したい文字列|style=スタイル}}{{Notice|text=表示したい文字列|title=タイトル(題)|style=スタイル}}{{Notice|text=表示したい文字列|header=ヘッダータイトル(題)|style=スタイル}}
スタイル
「スタイル」の部分には、announce, attention, fix, help, idea, important, propose, question, search, stop, warningの値を設定することができますが、一部のスタイルは画像が未設定のため利用できません。
- announce
| 表示したい文字列 |
- attention
| 表示したい文字列 |
- fix
| 表示したい文字列 |
- help
| ファイル:OOjs UI icon map-ltr-progressive.svg | 表示したい文字列 |
- idea
| ファイル:OOjs UI icon lightbulb-yellow.svg | 表示したい文字列 |
- important
| 表示したい文字列 |
- propose
| ファイル:Icons8 flat collaboration.svg | 表示したい文字列 |
- question
| ファイル:OOjs UI icon helpNotice-ltr-progressive.svg | 表示したい文字列 |
- search
| 表示したい文字列 |
- stop
| 表示したい文字列 |
- warning
| 表示したい文字列 |
- news
| ファイル:OOjs UI icon newspaper-ltr-progressive.svg | 表示したい文字列 |
小型化
小型化には|small=もしくは|section=が使えます。これらの引数の挙動はテンプレートを貼り付けたページが属する名前空間によって異なります。
標準名前空間の場合
記事の節で使いたい場合は、|section=に空でない値を指定するか、|small=leftとしてください(|small=rightや|small=yesのような指定は無効です)。|section=を使用した場合は幅一杯に表示されます。
{{Notice|表示したい文字列|section=1|demospace=main}}
表示したい文字列 |
{{Notice|表示したい文字列|small=left|demospace=main}}
表示したい文字列 |
ファイル名前空間もしくはCategory名前空間の場合
ファイル名前空間およびCategory名前空間で使用した場合は小型化ができません。
その他の名前空間の場合
|small=yesとしてください(|small=leftのような指定は無効です)。|section=は使えません。
{{Notice|表示したい文字列|small=yes}}
| 表示したい文字列 |
引数
| 引数 | 指定内容 | 既定値 | 説明 | |
|---|---|---|---|---|
| text | 1 | 任意の文字列 | なし | 表示する文章 |
| title | 2 | 任意の文字列 | なし | 強調して表示する題 |
| style | 3 | announce, attention, fix, help, idea, important, propose, question, search, stop, warning |
なし | 指定がなければnoticeスタイル
|
| header | 任意の文字列 | なし | ヘッダーにセンタリングした状態で強調して表示する題 | |
| section | 任意の文字列 | なし | 入力されていれば記事において節用のスタイルで表示 | |
| small | left / yes / no |
なし | 記事においてはleftを、それ以外の名前空間ではsmallを指定すれば小型化表示(ファイルとCategory名前空間では無効) | |
Mboxのテンプレートデータ
| パラメーター | 説明 | 型 | 状態 | |
|---|---|---|---|---|
| text | text 1 | 表示する文章 | 文字列 | 推奨 |
| title | title 2 | 強調して表示する題 | 文字列 | 推奨 |
| style | style 3 | 指定がなければnoticeスタイル
| 文字列 | 推奨 |
| header | header | ヘッダーにセンタリングした状態で強調して表示する題 | 文字列 | 省略可能 |
| section | section | 入力されていれば記事において節用のスタイルで表示 | 文字列 | 省略可能 |
| small | small | 記事においてはleftを、それ以外の名前空間ではsmallを指定すれば小型化表示(ファイルとCategory名前空間では無効)
| 文字列 | 省略可能 |
関連テンプレート
- {{注意}} - 注意を促す専用のテンプレート
- {{告知}} - 議論等の告知をするテンプレート
- {{Dablink}} - 曖昧さ回避用のテンプレート
- {{Memo}} - 汎用的なお知らせ、警告テンプレート