Template talk:Infobox:修订间差异

H萌娘,万物皆可H的百科全书!
跳到导航 跳到搜索
imported>=海豚=
(创建页面,内容为“==由MJH提出的对Template:Infobox的编辑请求== 将以下内容: <div style="border:2px solid #000;padding:10px 15px;background-color:#f0faff"><pre><nowi…”)
 
imported>=海豚=
无编辑摘要
第79行: 第79行:
::::是不是那边的loop模块实现不一样?这边的loop模块里面loop和main是完全等价的,loop换成main没道理造成任何影响。 --<ruby style="padding:0.2em;"><rb>[[User:MJH|M.]]</rb><rt>Me.</rt></ruby> <ruby style="padding:0.2em;"><rb>[[User_talk:MJH|J.]]</rb><rt>Jot something down.</rt></ruby> <ruby style="padding:0.2em;"><rb>[[Special:用户贡献/MJH|H.]]</rb><rt>Hard work.</rt></ruby><small>【晋】</small><sup>[[User:MJH/evilforargs|&#123;&#123;#forargs:&#125;&#125; is evil!]]</sup> 2021年6月24日 (四) 09:44 (CST)
::::是不是那边的loop模块实现不一样?这边的loop模块里面loop和main是完全等价的,loop换成main没道理造成任何影响。 --<ruby style="padding:0.2em;"><rb>[[User:MJH|M.]]</rb><rt>Me.</rt></ruby> <ruby style="padding:0.2em;"><rb>[[User_talk:MJH|J.]]</rb><rt>Jot something down.</rt></ruby> <ruby style="padding:0.2em;"><rb>[[Special:用户贡献/MJH|H.]]</rb><rt>Hard work.</rt></ruby><small>【晋】</small><sup>[[User:MJH/evilforargs|&#123;&#123;#forargs:&#125;&#125; is evil!]]</sup> 2021年6月24日 (四) 09:44 (CST)
:::::那里的模块没更新,刚才我更了就好了,现在只显示:{{color|red|表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。}}
:::::那里的模块没更新,刚才我更了就好了,现在只显示:{{color|red|表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。}}
{{hide|源代码|<pre><nowiki>{| class="{{{class|infobox}}}" align={{{align|right}}} style="font-size:{{{font-size|89%}}}; {{{text-align|text-align:center}}}; width:{{{width|260px}}}; max-width:{{{max-width|100%}}}; float:{{{float|right}}}; background-color:{{{bg-color|#FFF}}};"
{{{title-main|{{!}} colspan="{{{colspan-site|2}}}" style="background-color:{{{title-color|#26ca9b}}}; color:{{{text-color|#FFFFFF}}}; font-size:100%; padding:1em;" {{!}} {{{Title|}}} }}}
|-
{{#if: {{{image|}}} |
{{!}} colspan= "{{{colspan-site|2}}}" {{!}} [[File:{{{image}}}|{{#if:{{{size|}}} | {{{size}}} | 280px}}]]<br/>{{{caption| }}}
|{{!}} colspan= "{{{colspan-site|2}}}" {{!}}{{{image-lostmessage|}}}
}}
|-
{{#if: {{{tabs| }}}|
{{!}} colspan="{{{colspan-site|2}}}" {{!}} {{{tabs| }}}
|
}}
{{Infobox/brick|column1= {{{Row x1|}}} |column1 style= {{{Row x1 style|}}} colspan="{{{colspan-site|2}}}"  }}
{{Infobox/brick|column1= {{{Row x2|}}} |column1 style= {{{Row x2 style|}}} colspan="{{{colspan-site|2}}}"  }}
{{#vardefine:maxidx|0}}{{#forargs:Row |k|v|{{#if:{{#vardefineecho:idx|{{str_match|str={{#var:k}}|ptn=^(%d+) title$}}}}|
{{#ifexpr:{{#var:maxidx}}<{{#var:idx}}|{{#vardefine:maxidx|{{#var:idx}}}}}}
}}}}
{{#invoke:loop|main|time=1|{{#var:maxidx}}
|do=<nowiki>
{{Infobox/brick|column1= {{{Row {{#var:time}} title|}}}|column1 style= {{{Row {{#var:time}} titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}"
|column2= {{{Row {{#var:time}} info|}}}|column2 style={{{Row {{#var:time}} infostyle| {{{Row infostyle|}}} }}} }}
</nowiki>
}}
{{Infobox/brick|column1= {{{Row h1 title|}}} |column1 style= {{{Row h1 titlestyle|}}} colspan="{{{colspan-site|2}}}" bgcolor="{{{under-column-color|#62bca9}}}" }}
{{Infobox/brick|column1= {{clear}}
{{{Row h1 info|}}} |column1 style= {{{Row h1 infostyle|}}} colspan="{{{colspan-site|2}}}" }}
{{Infobox/brick|column1= {{{Row h2 title|}}} |column1 style= {{{Row h2 titlestyle|}}} colspan="{{{colspan-site|2}}}" bgcolor="{{{under-column-color|#62bca9}}}" }}
{{Infobox/brick|column1= {{clear}}
{{{Row h2 info|}}} |column1 style= {{{Row h2 infostyle|}}} colspan="{{{colspan-site|2}}}" }}
|-
{{{Row b1| }}}
|-
{{{Row b2| }}}
|}</nowiki></pre>
}}
::::::你在那边ping我一下我看看吧,有点怪…… --<ruby style="padding:0.2em;"><rb>[[User:MJH|M.]]</rb><rt>Me.</rt></ruby> <ruby style="padding:0.2em;"><rb>[[User_talk:MJH|J.]]</rb><rt>Join the talk.</rt></ruby> <ruby style="padding:0.2em;"><rb>[[Special:用户贡献/MJH|H.]]</rb><rt>Hard work.</rt></ruby><small>【艮】</small><sup>[[User:MJH/evilforargs|&#123;&#123;#forargs:&#125;&#125; is evil!]]</sup> 2021年6月24日 (四) 09:56 (CST)
::::::你在那边ping我一下我看看吧,有点怪…… --<ruby style="padding:0.2em;"><rb>[[User:MJH|M.]]</rb><rt>Me.</rt></ruby> <ruby style="padding:0.2em;"><rb>[[User_talk:MJH|J.]]</rb><rt>Join the talk.</rt></ruby> <ruby style="padding:0.2em;"><rb>[[Special:用户贡献/MJH|H.]]</rb><rt>Hard work.</rt></ruby><small>【艮】</small><sup>[[User:MJH/evilforargs|&#123;&#123;#forargs:&#125;&#125; is evil!]]</sup> 2021年6月24日 (四) 09:56 (CST)
----
----
{{@|MJH}}情况就是这样,不要看模板下面的介绍文件,那个是嵌入萌百的,请查看嵌入此模板的条目--<img src="https://www.hmoegirl.com/images/avatars/574894/128.png?ver=1598093246" style="width: 2.5em;border-radius: 50%;"/> [[User:=海豚=|=海豚=]]([[用户讨论:=海豚=/备忘录|留言]] · [[特殊:用户贡献/=海豚=|贡献]] · [[用户讨论:=海豚=|讨论]]) 2021年6月24日 (四) 10:05 (CST)
{{@|MJH}}情况就是这样,不要看模板下面的介绍文件,那个是嵌入萌百的,请查看嵌入此模板的条目--<img src="https://www.hmoegirl.com/images/avatars/574894/128.png?ver=1598093246" style="width: 2.5em;border-radius: 50%;"/> [[User:=海豚=|=海豚=]]([[用户讨论:=海豚=/备忘录|留言]] · [[特殊:用户贡献/=海豚=|贡献]] · [[用户讨论:=海豚=|讨论]]) 2021年6月24日 (四) 10:05 (CST)

2021年6月24日 (四) 10:06的版本

由MJH提出的对Template:Infobox的编辑请求

将以下内容:

{{Infobox/brick|column1= {{{Row 1 title|}}}|column1 style= {{{Row 1 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 1 info|}}}|column2 style={{{Row 1 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 2 title|}}}|column1 style= {{{Row 2 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 2 info|}}}|column2 style={{{Row 2 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 3 title|}}}|column1 style= {{{Row 3 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 3 info|}}}|column2 style={{{Row 3 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 4 title|}}}|column1 style= {{{Row 4 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 4 info|}}}|column2 style={{{Row 4 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 5 title|}}}|column1 style= {{{Row 5 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 5 info|}}}|column2 style={{{Row 5 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 6 title|}}}|column1 style= {{{Row 6 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 6 info|}}}|column2 style={{{Row 6 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 7 title|}}}|column1 style= {{{Row 7 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 7 info|}}}|column2 style={{{Row 7 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 8 title|}}}|column1 style= {{{Row 8 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 8 info|}}}|column2 style={{{Row 8 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 9 title|}}}|column1 style= {{{Row 9 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 9 info|}}}|column2 style={{{Row 9 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 10 title|}}}|column1 style= {{{Row 10 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 10 info|}}}|column2 style={{{Row 10 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 11 title|}}}|column1 style= {{{Row 11 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 11 info|}}}|column2 style={{{Row 11 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 12 title|}}}|column1 style= {{{Row 12 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 12 info|}}}|column2 style={{{Row 12 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 13 title|}}}|column1 style= {{{Row 13 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 13 info|}}}|column2 style={{{Row 13 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 14 title|}}}|column1 style= {{{Row 14 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 14 info|}}}|column2 style={{{Row 14 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 15 title|}}}|column1 style= {{{Row 15 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 15 info|}}}|column2 style={{{Row 15 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 16 title|}}}|column1 style= {{{Row 16 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 16 info|}}}|column2 style={{{Row 16 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 17 title|}}}|column1 style= {{{Row 17 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 17 info|}}}|column2 style={{{Row 17 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 18 title|}}}|column1 style= {{{Row 18 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 18 info|}}}|column2 style={{{Row 18 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 19 title|}}}|column1 style= {{{Row 19 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 19 info|}}}|column2 style={{{Row 19 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 20 title|}}}|column1 style= {{{Row 20 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 20 info|}}}|column2 style={{{Row 20 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 21 title|}}}|column1 style= {{{Row 21 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 21 info|}}}|column2 style={{{Row 21 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 22 title|}}}|column1 style= {{{Row 22 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 22 info|}}}|column2 style={{{Row 22 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 23 title|}}}|column1 style= {{{Row 23 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 23 info|}}}|column2 style={{{Row 23 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 24 title|}}}|column1 style= {{{Row 24 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 24 info|}}}|column2 style={{{Row 24 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 25 title|}}}|column1 style= {{{Row 25 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 25 info|}}}|column2 style={{{Row 25 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 26 title|}}}|column1 style= {{{Row 26 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 26 info|}}}|column2 style={{{Row 26 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 27 title|}}}|column1 style= {{{Row 27 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 27 info|}}}|column2 style={{{Row 27 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 28 title|}}}|column1 style= {{{Row 28 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 28 info|}}}|column2 style={{{Row 28 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 29 title|}}}|column1 style= {{{Row 29 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 29 info|}}}|column2 style={{{Row 29 infostyle| {{{Row infostyle|}}} }}} }}
{{Infobox/brick|column1= {{{Row 30 title|}}}|column1 style= {{{Row 30 titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row 30 info|}}}|column2 style={{{Row 30 infostyle| {{{Row infostyle|}}} }}} }}

修改为:

{{#vardefine:maxidx|0}}{{#forargs:Row |k|v|{{#if:{{#vardefineecho:idx|{{str_match|str={{#var:k}}|ptn=^(%d+) title$}}}}|
{{#ifexpr:{{#var:maxidx}}<{{#var:idx}}|{{#vardefine:maxidx|{{#var:idx}}}}}}
}}}}<!-- 这里先loop一遍记录maxidx是为了绕过#forargs依赖参数顺序的特性,保证row 1 title始终排在row 2 title前面。 -->
{{#invoke:loop|loop|time=1|{{#var:maxidx}}
|do=<nowiki>
{{Infobox/brick|column1= {{{Row {{#var:time}} title|}}}|column1 style= {{{Row {{#var:time}} titlestyle| {{{Row titlestyle|}}} }}} bgcolor="{{{left-column-color|#E0FFFF}}}" 
|column2= {{{Row {{#var:time}} info|}}}|column2 style={{{Row {{#var:time}} infostyle| {{{Row infostyle|}}} }}} }}
</nowiki>
}}

此外,关于对#forargs依赖参数顺序的特性的批判,参见User:MJH/evilforargs。——M.Me. J.Jot something down. H.History.【萃】 2021年6月16日 (三) 12:57 (CST)回复[回复]

@MJH使用后显示:表达式错误:无法识别的标点“[”,脚本错误:函数“loop”不存在。--悠远的苍穹 (Talk with me!) 2021年6月24日 (四) 09:33 (CST)回复[回复]
欸欸?!我可以看一下对应的沙盒页面固定链接吗…… --M.Me. J.Just a chat. H.Heritage.【观】{{#forargs:}} is evil! 2021年6月24日 (四) 09:35 (CST)回复[回复]
似乎{{#invoke:loop|loop|应该改为{{#invoke:loop|main|,还有我没在这里实验,不过我想你应该知道我会在哪里实验。。。--悠远的苍穹 (Talk with me!) 2021年6月24日 (四) 09:37 (CST)
@MJH你退群后,我失去了你的QQ,你可以加我的 QQ:850710247--悠远的苍穹 (Talk with me!) 2021年6月24日 (四) 09:42 (CST)回复[回复]
是不是那边的loop模块实现不一样?这边的loop模块里面loop和main是完全等价的,loop换成main没道理造成任何影响。 --M.Me. J.Jot something down. H.Hard work.【晋】{{#forargs:}} is evil! 2021年6月24日 (四) 09:44 (CST)回复[回复]
那里的模块没更新,刚才我更了就好了,现在只显示:表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。表达式错误:无法识别的标点“[”。
你在那边ping我一下我看看吧,有点怪…… --M.Me. J.Join the talk. H.Hard work.【艮】{{#forargs:}} is evil! 2021年6月24日 (四) 09:56 (CST)回复[回复]

@MJH情况就是这样,不要看模板下面的介绍文件,那个是嵌入萌百的,请查看嵌入此模板的条目--<img src="https://www.hmoegirl.com/images/avatars/574894/128.png?ver=1598093246" style="width: 2.5em;border-radius: 50%;"/> =海豚=留言 · 贡献 · 讨论) 2021年6月24日 (四) 10:05 (CST)回复[回复]