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

来自魔法少女小圆维基
跳到导航 跳到搜索
第1行: 第1行:
 
<includeonly>|-
 
<includeonly>|-
 
{{#if: {{{header|}}}
 
{{#if: {{{header|}}}
   |! colspan="2" class="{{{headerclass|theme}}}" style="text-align: center; {{{headerstyle|}}}" {{!}} {{{header}}}
+
   |! colspan="2" class="{{#if:{{{headerclass|}}}|{{{headerclass}}}|theme}}" style="text-align: center; {{{headerstyle|}}}" {{!}} {{{header}}}
 
   |{{#if: {{{2|}}} 
 
   |{{#if: {{{2|}}} 
    |{{!}} class="{{{labelclass|theme-light}}}" style="text-align: left; padding-left:2px; padding-right:2px; {{{labelstyle|}}}" nowrap {{!}} {{#if: {{{1|}}} | '''{{{1|}}}'''}}
+
    |{{!}} class="{{#if:{{{labelclass|}}}|{{{labelclass}}}|theme-light}}" style="text-align: left; padding-left:2px; padding-right:2px; {{{labelstyle|}}}" nowrap {{!}} {{#if: {{{1|}}} | '''{{{1|}}}'''}}
 
     {{!}} class="{{{dataclass|}}}" style="text-align: left; padding-left:1px; padding-right:1px; {{{datastyle|}}}" {{!}} {{{2}}}
 
     {{!}} class="{{{dataclass|}}}" style="text-align: left; padding-left:1px; padding-right:1px; {{{datastyle|}}}" {{!}} {{{2}}}
 
    |{{#ifeq: {{{force|}}} | <!-- empty --> | <!-- then show nothing because {{{2}}} empty -->
 
    |{{#ifeq: {{{force|}}} | <!-- empty --> | <!-- then show nothing because {{{2}}} empty -->
 
      |{{#if: {{{1|}}} <!-- else -->
 
      |{{#if: {{{1|}}} <!-- else -->
       |{{!}} class="{{{labelclass|theme-light}}}" style="text-align: left; padding-left:2px; padding-right:2px; {{{labelstyle|}}}" nowrap {{!}} '''{{{1}}}'''
+
       |{{!}} class="{{#if:{{{labelclass|}}}|{{{labelclass}}}|theme-light}}" style="text-align: left; padding-left:2px; padding-right:2px; {{{labelstyle|}}}" nowrap {{!}} '''{{{1}}}'''
 
        {{!}} class="{{{dataclass|}}}" style="text-align: left; padding-left:1px; padding-right:1px; {{{datastyle|}}}" {{!}} {{{2|}}}
 
        {{!}} class="{{{dataclass|}}}" style="text-align: left; padding-left:1px; padding-right:1px; {{{datastyle|}}}" {{!}} {{{2|}}}
 
       }}
 
       }}

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


来源
http://zh.moegirl.org/index.php?title=Template:Infobox/row
用处
配合其他infobox系列模板使用,拓展其他infobox系列模板
语法
用法一:
{{infobox/row|header=小标题|headerclass=小标题类|headerstyle=小标题样式}}
用法二:
{{infobox/row|标签|数据|labelclass=标签类|labelstyle=标签样式|dataclass=数据类|datastyle=数据样式|force=即使数据为空,依然显示}}
范例
{{infobox/话|
|name=魔法少女小圆
|episode=3
|image=Episode3.jpg
|title=已经没什么好怕的了 |japtitle=もう何も怖くない
|脚本=虚渊玄
|previous = [[魔法少女小圆 第2话「それはとっても嬉しいなって」|第2话 「那真是太令人高兴了」]]
|next = [[魔法少女小圆 第4话「奇跡も、魔法も、あるんだよ」|第4话 「奇迹和魔法都是存在的」]]
|other={{infobox/row|header=额外章节}}
{{infobox/row|额外职位1|魔法少女贞德}}
{{infobox/row|2=魔法少女杨贵妃|labelstyle=background-color:transparent !important;}}
{{infobox/row|2=魔法少女奥巴马|labelstyle=background-color:transparent !important;|dataclass=theme-light|force=true}}
{{infobox/row|额外职位2|force=NoMatterWhatHere}}
{{infobox/row|额外职位3}}
}}
将产生如下效果
魔法少女小圆
第3话
250px
'
标题 已经没什么好怕的了
日文标题 もう何も怖くない
脚本 虚渊玄
跳转
←前一话
第2话 「那真是太令人高兴了」
后一话→
第4话 「奇迹和魔法都是存在的」
额外章节
额外职位1 魔法少女贞德
魔法少女杨贵妃
魔法少女奥巴马
额外职位2