コンテンツにスキップ

「テンプレート:Notice」の版間の差分

提供:信号機Wiki
羽井出 (トーク | 投稿記録)
画像の参照先を変更
羽井出 (トーク | 投稿記録)
画像の参照先を変更
 
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-destructive.svg
  | attention = OOjs UI icon alert destructive black-darkred.svg.png
  | important = OOjs UI icon notice-warning.svg
  | 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-destructive.svg
  | attention = OOjs UI icon alert destructive black-darkred.svg.png
  | important = OOjs UI icon notice-warning.svg
  | 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
idea
important
propose
question
search
stop
warning
news

小型化[ソースを編集]

小型化には|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のテンプレートデータ

テンプレートパラメーター[テンプレートデータを編集]

パラメーター説明状態
texttext 1

表示する文章

文字列推奨
titletitle 2

強調して表示する題

文字列推奨
stylestyle 3

指定がなければnoticeスタイル

値の候補
notice attention fix important search stop
既定
notice
文字列推奨
headerheader

ヘッダーにセンタリングした状態で強調して表示する題

文字列省略可能
sectionsection

入力されていれば記事において節用のスタイルで表示

文字列省略可能
smallsmall

記事においてはleftを、それ以外の名前空間ではsmallを指定すれば小型化表示(ファイルとCategory名前空間では無効)

値の候補
left yes no
文字列省略可能

関連テンプレート[ソースを編集]

  • {{注意}} - 注意を促す専用のテンプレート
  • {{告知}} - 議論等の告知をするテンプレート
  • {{Dablink}} - 曖昧さ回避用のテンプレート
  • {{Memo}} - 汎用的なお知らせ、警告テンプレート

関連項目[ソースを編集]