「テンプレート:Infobox/doc」の版間の差分

提供: Yourpedia
移動: 案内検索
(テストも兼ねて、色々書き直し)
(ほぼ完成かも)
1行目: 1行目:
'''Infobox'''テンプレートは、Infoboxを作成するための[[メタテンプレート]]です。記事に直接使われることは想定していません。現在、条件文を使わない版を開発中ですが、テンプレートの中でタグを使われると表示が壊れるバグが解消できていないため、まだ使えません。
+
'''Infobox'''テンプレートは、Infoboxを作成するための[[メタテンプレート]]です。Wikipediaの同名テンプレートとの互換を実現するために作成したものですが、引数とその指定方法に違いがあるため、移入には調整を要します。
  
 
== 引数一覧 ==
 
== 引数一覧 ==
 
*body全体にかかる引数
 
*body全体にかかる引数
**クラス(class)は「infobox」が既定値になっており、引数「bodyclass」を指定すると、「infobox (bodyclass)」というクラスになります。
+
**'''bodyclass''':cssクラスを指定します。既定値は「infobox」に設定されており、引数を指定すると「infobox (bodyclass)」という名前のクラスになります。
**スタイル(style)は幅22em(width:22em)が規定値として設定されており、それ以外のスタイルは引数「bodystyle」で指定します。
+
**'''bodystyle''':スタイルを指定します。既定値として幅(width)が22emに設定されており、引数を指定するとスタイルが追加されます。
*最下部の、テンプレート本体への内部リンクは、引数「name」または「tnavbar」に「テンプレート:ほげほげ」の「ほげほげ」にあたる文字列を入力すると、正常に設定されます。
+
*最下部の、テンプレート本体への内部リンク
 +
**'''name'''または'''tnavbar''':「テンプレート:ほげほげ」の「ほげほげ」にあたる文字列を入力します。
 +
**'''nameflag'''または'''tnavbarflag''':引数の入力があれば表示され、なければ表示されません。
 
*引数「child」を指定することによって、別のInfobox内に組込み可能なInfobox(Infoboxからtableタグをなくした版)にすることは、今のところ、できません。
 
*引数「child」を指定することによって、別のInfobox内に組込み可能なInfobox(Infoboxからtableタグをなくした版)にすることは、今のところ、できません。
  
 +
*以下で、'''☆印'''は、入力があればテーブルの中に当該行が表示され、入力がなければ表示されなくなる引数です。
 +
**テーブルの各行の表示・非表示は、データ(data)の有無ではなく、ヘッダ(header)・ラベル(label)またはフラグ(flag)の入力によって選択・制御する仕組みになっています。
 +
**ヘッダとラベルの入力は出力表示にも利用されます。フラグの入力は内部で行の表示制御のみに使用します。'''ヘッダ・ラベル・フラグに入力する内容は任意ですが、refタグを使用すると表示が壊れるため、使用しないでください'''。なお、データには使用しても大丈夫です。
 
{{Multicol}}
 
{{Multicol}}
 
=== コンテンツ ===
 
=== コンテンツ ===
 
{{Infobox/sandbox2
 
{{Infobox/sandbox2
|title          = title
+
|title          = title☆
|above          = above
+
|above          = above☆
 
|abovestyle      = background-color:#ccf
 
|abovestyle      = background-color:#ccf
 
|headerstyle    = background-color:#ccf
 
|headerstyle    = background-color:#ccf
|subheader      = subheader<br /> 
+
|subheaderflag  = subheaderflag
|subheader2      = subheader2<br /> 
+
|subheader      = subheader subheaderflag☆<br /> 
|image          = image<br /> 
+
|subheaderflag2  = subheaderflag2
|caption        = caption
+
|subheader2      = subheader2 subheaderflag2☆<br /> 
|image2          = image2<br /> 
+
|imageflag      = imageflag
|caption2        = caption2
+
|image          = image imageflag☆<br /> 
|header1  = header1
+
|caption        = caption 同上☆
|label1  = label1
+
|imageflag2      = imageflag2
 +
|image2          = image2 imageflag2☆<br /> 
 +
|caption2        = caption2 同上☆
 +
|header1  = header1☆
 +
|label1  = label1☆
 
|data1    = data1
 
|data1    = data1
|header2  = header2
+
|header2  = header2☆
|label2  = label2
+
|label2  = label2☆
 
|data2    = data2
 
|data2    = data2
 
|header3  = …
 
|header3  = …
 
|label3  = …
 
|label3  = …
 
|data3    = …
 
|data3    = …
|header50  = header50
+
|header50  = header50☆
|label50  = label50
+
|label50  = label50☆
 
|data50    = data50
 
|data50    = data50
 +
|belowflag  = belowflag
 +
|below      = below belowflag☆
 
|belowstyle = background-color:#ccf
 
|belowstyle = background-color:#ccf
|below = below
+
|tnavbarflag = tnavbarflag
 
}}
 
}}
 
{{Multicol-break}}
 
{{Multicol-break}}
43行目: 54行目:
 
|abovestyle      = background-color:#ccf
 
|abovestyle      = background-color:#ccf
 
|headerstyle    = background-color:#ccf
 
|headerstyle    = background-color:#ccf
 +
|subheaderflag  = subheaderflag
 
|subheader      = subheaderclass,<br />subheaderrowclass
 
|subheader      = subheaderclass,<br />subheaderrowclass
 +
|subheaderflag2  = subheaderflag2
 
|subheader2      = subheaderclass,<br />subheaderclass2
 
|subheader2      = subheaderclass,<br />subheaderclass2
 +
|imageflag      = imageflag
 
|image          = imageclass,<br />imagerowclass
 
|image          = imageclass,<br />imagerowclass
|caption        = (なし)
+
|caption        = 同上
 +
|imageflag2      = imageflag2
 
|image2          = imageclass,<br />imagerowclass2
 
|image2          = imageclass,<br />imagerowclass2
|caption2        = (なし)
+
|caption2        = 同上
 
|header1  = class1
 
|header1  = class1
 
|label1  = rowclass1
 
|label1  = rowclass1
61行目: 76行目:
 
|label50  = rowclass50
 
|label50  = rowclass50
 
|data50    = class50, rowclass50
 
|data50    = class50, rowclass50
 +
|belowflag  = belowflag
 +
|below      = belowclass
 
|belowstyle = background-color:#ccf
 
|belowstyle = background-color:#ccf
|below = belowclass
+
|tnavbarflag = tnavbarflag
 
}}
 
}}
 
{{Multicol-break}}
 
{{Multicol-break}}
71行目: 88行目:
 
|abovestyle      = background-color:#ccf
 
|abovestyle      = background-color:#ccf
 
|headerstyle    = background-color:#ccf
 
|headerstyle    = background-color:#ccf
 +
|subheaderflag  = subheaderflag
 
|subheader      = subheaderstyle,<br />subheaderstyle1
 
|subheader      = subheaderstyle,<br />subheaderstyle1
 +
|subheaderflag2  = subheaderflag2
 
|subheader2      = subheaderstyle,<br />subheaderstyle2
 
|subheader2      = subheaderstyle,<br />subheaderstyle2
 +
|imageflag      = imageflag
 
|image          = imagestyle<br /> 
 
|image          = imagestyle<br /> 
 
|caption        = captionstyle
 
|caption        = captionstyle
 +
|imageflag2      = imageflag2
 
|image2          = imagestyle<br /> 
 
|image2          = imagestyle<br /> 
 
|caption2        = captionstyle
 
|caption2        = captionstyle
89行目: 110行目:
 
|label50  = 同上
 
|label50  = 同上
 
|data50    = 同上
 
|data50    = 同上
 +
|belowflag  = belowflag
 +
|below      = belowstyle
 
|belowstyle = background-color:#ccf
 
|belowstyle = background-color:#ccf
|below = belowstyle
+
|tnavbarflag = tnavbarflag
 
}}
 
}}
 
{{multicol-end}}
 
{{multicol-end}}
99行目: 122行目:
 
|bodyclass  =
 
|bodyclass  =
 
|bodystyle  =
 
|bodystyle  =
 +
 
|title      =
 
|title      =
 
|titleclass =
 
|titleclass =
106行目: 130行目:
 
|abovestyle =
 
|abovestyle =
  
 +
|subheaderflag    =
 
|subheader        =
 
|subheader        =
 
|subheaderclass    =
 
|subheaderclass    =
111行目: 136行目:
 
|subheaderstyle    =
 
|subheaderstyle    =
  
 +
|subheaderflag2    =
 
|subheader2        =
 
|subheader2        =
 
|subheaderrowclass2 =
 
|subheaderrowclass2 =
  
 +
|imageflag    =
 
|image        =
 
|image        =
 
|imageclass    =
 
|imageclass    =
121行目: 148行目:
 
|captionstyle  =
 
|captionstyle  =
  
 +
|imageflag2    =
 
|image2        =
 
|image2        =
 
|imagerowclass2 =
 
|imagerowclass2 =
143行目: 171行目:
 
.
 
.
 
.
 
.
|header50   =
+
|header50   =
|class50   =
+
|class50     =
|label50   =
+
|label50     =
|rowclass50 =
+
|rowclass50 =
|data50     =
+
|data50     =
 +
 
 +
|belowflag  =
 +
|below      =
 +
|belowclass  =
 +
|belowstyle  =
  
|below      =
+
|tnavbarflag = tnavbarflag
|belowclass =
+
|tnavbar     =
|belowstyle =
+
|tnavbar   =
+
 
}}
 
}}
 
</pre>
 
</pre>

2018年5月11日 (金) 20:16時点における版

Infoboxテンプレートは、Infoboxを作成するためのメタテンプレートです。Wikipediaの同名テンプレートとの互換を実現するために作成したものですが、引数とその指定方法に違いがあるため、移入には調整を要します。

引数一覧

  • body全体にかかる引数
    • bodyclass:cssクラスを指定します。既定値は「infobox」に設定されており、引数を指定すると「infobox (bodyclass)」という名前のクラスになります。
    • bodystyle:スタイルを指定します。既定値として幅(width)が22emに設定されており、引数を指定するとスタイルが追加されます。
  • 最下部の、テンプレート本体への内部リンク
    • nameまたはtnavbar:「テンプレート:ほげほげ」の「ほげほげ」にあたる文字列を入力します。
    • nameflagまたはtnavbarflag:引数の入力があれば表示され、なければ表示されません。
  • 引数「child」を指定することによって、別のInfobox内に組込み可能なInfobox(Infoboxからtableタグをなくした版)にすることは、今のところ、できません。
  • 以下で、☆印は、入力があればテーブルの中に当該行が表示され、入力がなければ表示されなくなる引数です。
    • テーブルの各行の表示・非表示は、データ(data)の有無ではなく、ヘッダ(header)・ラベル(label)またはフラグ(flag)の入力によって選択・制御する仕組みになっています。
    • ヘッダとラベルの入力は出力表示にも利用されます。フラグの入力は内部で行の表示制御のみに使用します。ヘッダ・ラベル・フラグに入力する内容は任意ですが、refタグを使用すると表示が壊れるため、使用しないでください。なお、データには使用しても大丈夫です。


フォーマット

{{Infobox
|bodyclass  =
|bodystyle  =

|title      =
|titleclass =
|titlestyle =
|above      =
|aboveclass =
|abovestyle =

|subheaderflag     =
|subheader         =
|subheaderclass    =
|subheaderrowclass =
|subheaderstyle    =

|subheaderflag2     =
|subheader2         =
|subheaderrowclass2 =

|imageflag     =
|image         =
|imageclass    =
|imagerowclass =
|imagestyle    =
|caption       =
|captionstyle  =

|imageflag2     =
|image2         =
|imagerowclass2 =
|caption2       =

|headerstyle =
|labelstyle  =
|datastyle   =

|header1   =
|class1    =
|label1    =
|rowclass1 =
|data1     =

|header2   =
|class2    =
|label2    =
|rowclass2 =
|data2     =
.
.
.
|header50    =
|class50     =
|label50     =
|rowclass50  =
|data50      =

|belowflag   = 
|below       = 
|belowclass  =
|belowstyle  =

|tnavbarflag = tnavbarflag
|tnavbar     =
}}