两侧同时换到之前的修订记录
前一修订版
后一修订版
|
前一修订版
|
template:infobox [2021/02/21 03:42] A135(2) 修复移动版视图信息框表格不自动换行的问题 |
template:infobox [2022/05/13 09:22] (当前版本) A135 更新内部语法 |
| |
===== 语法 ===== | ===== 语法 ===== |
''%%{{tplt>infobox|title=×××|img=×××|info=×××}}%%'' | ''%%[|infobox|title=×××|img=×××|info=×××|]%%'' |
| |
这个模板用到的参数: | 这个模板用到的参数: |
| |
===== 注意事项 ===== | ===== 注意事项 ===== |
* 竖杠符号(''|'')在模板中用于分隔参数,因此如果要在参数值当中使用''|''(例如插入一个表格),请使用''%%{{!}}%%''代替。 | * 竖杠符号(''|'')在模板中用于分隔参数,因此如果要在参数值当中使用''|''(例如插入一个表格),请使用''%%~~!~~%%''代替。 |
* 此模板依赖bootstrap主题,换用其他主题可能会使信息框外观显示不正常。 | * 此模板依赖bootstrap主题,换用其他主题可能会使信息框外观显示不正常。 |
| |
===== 示例 ===== | ===== 示例 ===== |
<code> | <code> |
{{tplt>infobox | [|infobox |
|title=DokuWiki | |title=DokuWiki |
|img={{wiki:dokuwiki-128.png}} | |img={{wiki:dokuwiki-128.png}} |
|info= | |info= |
^ 基本信息 ^^ | ^ 基本信息 ^^ |
{{!}}名称{{!}}DokuWiki{{!}} | ^ 名称 ~~!~~ DokuWiki ~~!~~ |
{{!}}地址{{!}}dokuwiki.org{{!}} }} | ^ 地址 ~~!~~ dokuwiki.org ~~!~~ |] |
</code> | </code> |
效果如下: | 效果如下: |
<html><style> | [|infobox |
#wrap_infobox{max-width: 100%; width: 300px; float: right; clear: right; margin-left: 1.5em;} | |title=DokuWiki |
@media screen and (max-width: 767px){#wrap_infobox{width: 100%; float: none; clear: right; display: block; margin-left: auto; margin-right: auto} #wrap_infobox table, #wrap_infobox table thead tr th, #wrap_infobox table tbody tr td{white-space:normal} } | |img={{wiki:dokuwiki-128.png}} |
#wrap_infobox_imgs{text-align:center; font-size:0.875em} | |info= |
#wrap_infobox_imgs img{display:block; margin: 0.2em auto} | |
#wrap_infobox table{white-space:normal} | |
</style></html> | |
<WRAP #wrap_infobox> | |
<panel title="DokuWiki" no-body="true"> | |
<WRAP #wrap_infobox_imgs> | |
{{wiki:dokuwiki-128.png}} | |
</WRAP> | |
^ 基本信息 ^^ | ^ 基本信息 ^^ |
|名称|DokuWiki| | ^ 名称 ~~!~~ DokuWiki ~~!~~ |
|地址|dokuwiki.org| | ^ 地址 ~~!~~ dokuwiki.org ~~!~~ |] |
| |
</panel> | |
</WRAP> | |
</noinclude> | </noinclude> |
<includeonly> | <includeonly> |
<html><style> | <WRAP template_infobox-wrapper> |
#wrap_infobox{max-width: 100%; width: 300px; float: right; clear: right; margin-left: 1.5em;} | <panel no-body="true"> |
@media screen and (max-width: 767px){#wrap_infobox{width: 100%; float: none; clear: right; display: block; margin-left: auto; margin-right: auto} #wrap_infobox table, #wrap_infobox table thead tr th, #wrap_infobox table tbody tr td{white-space:normal} } | <panel-body><TEXT align="center" size="larger">{{{title=标题}}}</TEXT> |
#wrap_infobox_imgs{text-align:center; font-size:0.875em} | <WRAP template_infobox-imgs> |
#wrap_infobox_imgs img{display:block; margin: 0.2em auto} | |
</style></html> | |
<WRAP #wrap_infobox> | |
<panel title="{{{title=标题}}}" no-body="true"> | |
<WRAP #wrap_infobox_imgs> | |
{{{img= }}} | {{{img= }}} |
</WRAP> | </WRAP></panel-body> |
{{{info= }}} | {{{info= }}} |
</panel> | </panel> |
</WRAP> | </WRAP> |
</includeonly> | </includeonly> |
| |