“Template:Infobox/header”的版本间的差异

来自魔法少女小圆维基
跳到导航 跳到搜索
第1行: 第1行:
<includeonly>{| class="infobox" style="width: {{{宽度|300px}}}; text-align: center;"
+
<includeonly>{| class="infobox" style="width: {{#if:{{{宽度|}}}|{{{宽度}}}|300px}}; text-align: center;"
 
|- 
 
|- 
! class="{{{headerclass|theme}}}" colspan="2" style="font-size:120%; font-weight:bold;" | {{{标题|{{PAGENAME}} }}}
+
! class="{{#if:{{{headerclass|}}}|{{{headerclass}}|theme}}" colspan="2" style="font-size:120%; font-weight:bold;" | {{#if:{{{标题|}}}|{{{标题}}}|{{PAGENAME}}}}
 
{{#if: {{{日文名|{{{英文名|}}} }}}
 
{{#if: {{{日文名|{{{英文名|}}} }}}
   |{{!}}- class="{{{headerclass|theme}}}" style="text-align:center;"
+
   |{{!}}- class="{{#if:{{{headerclass|}}}|{{{headerclass}}|theme}}" style="text-align:center;"
 
{{!}} colspan="2" {{!}} {{#if: {{{日文名|}}}
 
{{!}} colspan="2" {{!}} {{#if: {{{日文名|}}}
 
    |{{lang|ja|{{{日文名}}} }} {{#if: {{{英文名|}}} |<br />{{lang|en|<i>{{{英文名}}}</i>}} }}
 
    |{{lang|ja|{{{日文名}}} }} {{#if: {{{英文名|}}} |<br />{{lang|en|<i>{{{英文名}}}</i>}} }}
第16行: 第16行:
 
    |{{#if:{{#pos:{{{封面}}}|Image:}}
 
    |{{#if:{{#pos:{{{封面}}}|Image:}}
 
     |{{{封面}}}
 
     |{{{封面}}}
     |[[File:{{{封面}}}|{{{宽度|300px}}}]]
+
     |[[File:{{{封面}}}|{{#if:{{{宽度|}}}|{{{宽度}}}|300px}}]]
 
    }}
 
    }}
 
   }}
 
   }}
第41行: 第41行:
 
 参见{{infobox/动画}}模板的源代码如:
 
 参见{{infobox/动画}}模板的源代码如:
 
{{infobox/header
 
{{infobox/header
  |宽度={{{宽度|{{{width|300px}}}}}}
+
  |宽度={{{宽度|{{{width|300px}}} }}}
  |标题={{{标题|{{{title|{{{名字|{{{name|{{PAGENAME}}}}}}}}}}}}}}
+
  |标题={{{标题|{{{title|{{{名字|{{{name|{{PAGENAME}} }}} }}} }}} }}}
  |日文名={{{日文名|{{{japname|}}}}}}
+
  |日文名={{{日文名|{{{japname|}}} }}}
  |英文名={{{英文名|{{{engname|}}}}}}
+
  |英文名={{{英文名|{{{engname|}}} }}}
  |其他译名={{{其他译名|{{{其它译名|{{{othername|}}}}}}}}}
+
  |其他译名={{{其他译名|{{{其它译名|{{{othername|}}} }}} }}}
  |封面={{{封面|{{{cover|{{{图片|{{{image|}}}}}}}}}}}}
+
  |封面={{{封面|{{{cover|{{{图片|{{{image|}}} }}} }}} }}}
 
}}
 
}}
 
{{infobox/row|系列定位|{{{系列定位|}}} }}
 
{{infobox/row|系列定位|{{{系列定位|}}} }}
第59行: 第59行:
 
:将产生如下效果
 
:将产生如下效果
 
 参见[[Template:Infobox/动画]]的说明。
 
 参见[[Template:Infobox/动画]]的说明。
注意:如果母模板{{infobox/动画}}得到的某个参数有可能未定义或为空字符串的话,比如{{infobox/动画|英文名=}},那将该参数传递给子模板{{infobox/header}}的时候不要额外增加空格,如{{infobox/header|英文名=不带空格的表达式}},以免{{infobox/header}}内把该参数误以为有非空的值。
 
 
</noinclude>
 
</noinclude>

2016年10月29日 (六) 01:08的版本

来源
用处
配合其他infobox/row等模板使用,拓展其他infobox系列模板
语法
{{infobox/header
 |headerclass= 用于{{infobox/角色}}等模板时可选填
 |labelclass= 用于{{infobox/角色}}等模板时可选填
 |dataclass= 用于{{infobox/角色}}等模板时可选填
 |宽度= 默认300px
 |标题=
 |日文名= 选填
 |英文名= 选填
 |其他译名= 选填
 |封面=
}}
范例
参见{{infobox/动画}}模板的源代码如:
{{infobox/header
 |宽度={{{宽度|{{{width|300px}}} }}}
 |标题={{{标题|{{{title|{{{名字|{{{name|{{PAGENAME}} }}} }}} }}} }}}
 |日文名={{{日文名|{{{japname|}}} }}}
 |英文名={{{英文名|{{{engname|}}} }}}
 |其他译名={{{其他译名|{{{其它译名|{{{othername|}}} }}} }}}
 |封面={{{封面|{{{cover|{{{图片|{{{image|}}} }}} }}} }}}
}}
{{infobox/row|系列定位|{{{系列定位|}}} }}
{{infobox/row|[[正典级别]]|{{{正典级别|}}} }}
{{infobox/row|主要角色|{{{主要角色|}}} }}
{{infobox/row|片头曲|{{{片头曲|}}} }}
{{infobox/row|片尾曲|{{{片尾曲|}}} }}
...
...
|}
将产生如下效果

参见Template:Infobox/动画的说明。