THDeb​(留言 | 贡献)
新增维基百科、百度百科外链卡片及简繁别名;独立编写中性文案与自适应样式,附参考来源和用法
THDeb​(留言 | 贡献)
百科链接卡片:用户指定图标、萌娘百科模板、修复模板页无效默认目标;中文文言加需🪜提示,六语言对应模板
第1行: 第1行:
<templatestyles src="Template:百科链接/样式.css" /><div class="tyzx-encyclopedia-link noprint"><span class="tyzx-encyclopedia-link__mark tyzx-encyclopedia-link__baidu" aria-hidden="true">百度</span><div class="tyzx-encyclopedia-link__heading">百度百科</div><div>{{{text|百度百科中有与本条目相关的内容:}}}<span class="tyzx-encyclopedia-link__target">[https://baike.baidu.com/item/{{urlencode:{{{name|{{{1|{{PAGENAME}}}}}}}}|WIKI}}{{#if:{{{id|}}}|/{{urlencode:{{{id}}}|WIKI}}}} {{{2|{{{name|{{{1|{{PAGENAME}}}}}}}}}}}]</span>。</div></div><noinclude>
<includeonly><templatestyles src="Template:百科链接/样式.css" /><div class="tyzx-encyclopedia-link tyzx-encyclopedia-link--baidu noprint"><div class="tyzx-encyclopedia-link__image">[[File:Tyzx external Baidu baike logo.svg|130px|link=|alt=百度百科]]</div><div class="tyzx-encyclopedia-link__heading">百度百科</div><div>{{{text|相关内容:}}}<span class="tyzx-encyclopedia-link__target">[https://baike.baidu.com/item/{{urlencode:{{{name|{{{1|{{PAGENAME}}}}}}}}|WIKI}}{{#if:{{{id|}}}|/{{urlencode:{{{id}}}|WIKI}}}} {{{2|{{{name|{{{1|{{PAGENAME}}}}}}}}}}}]</span></div></div></includeonly><noinclude>== 用法 ==
右侧百度百科链接卡片,小屏幕自动改为通栏。使用静态文字识别标,不加载外站图片。
== 用法 ==
<pre>{{接连百度百科|江苏省天一中学}}
<pre>{{接连百度百科|江苏省天一中学}}
{{接连百度百科|江苏省天一中学|天一中学}}
{{接连百度百科|江苏省天一中学|显示文字}}</pre>
{{接连百度百科|name=江苏省天一中学}}
模板页只展示明确填写目标的示例,不再链接模板自身名称。未填写参数时,正文中的调用仍默认使用当前词条名。请确认外站目标存在;模板不能自动检测外站红链。
{{接连百度百科|词条名|显示文字|id=数字ID}}</pre>
== 参数 ==
* 第一个参数:百度百科目标词条名;省略时使用当前页面名。
* <code>1</code>: 目标词条名;<code>2</code> 为显示文字。
* 第二个参数:显示文字;默认与目标相同。
* <code>text</code>: 可选介绍。
* <code>name</code>:目标词条名的命名参数,优先于第一个参数。
* <code>name</code>: 优先于第一个参数的目标名。<code>id</code>:可选数字消歧 ID,须与目标名同时使用。旧式仅填数字的参数不适用。
* <code>id</code>:可选的消歧数字 ID,须从实际目标链接中核对;不要仅填写数字 ID 代替词条名。
* <code>text</code>:可选的介绍文字。模板不检查目标页面是否存在。
* 繁体别名:<code><nowiki>{{接連百度百科|词条名}}</nowiki></code>。
== 示例 ==
== 示例 ==
{{接连百度百科|江苏省天一中学}}
{{接连百度百科|江苏省天一中学}}
<div style="clear:both"></div>
<div style="clear:both"></div>
== 说明 ==
[https://uncyclopedia.tw/wiki/Template:接連百度百科 排版参考] · [[File:Tyzx external Baidu baike logo.svg|图标来源与权利说明]]
独立编写的天一维基模板,排版参考[https://uncyclopedia.tw/wiki/Template:接連百度百科 偽基百科的同名模板];使用中性说明,不转载原站的讽刺文案或图像。使用现行 <code>/item/词条名</code> 链接,不照搬原模板的旧式 <code>/view/数字ID</code> 参数。外部链接不能代替对具体事实的来源核验。
[[lzh:Template:接连百度百科]]
<templatedata>{"description":"添加右侧百度百科相关条目链接卡片。","params":{"1":{"label":"目标词条名","type":"string"},"2":{"label":"显示文字","type":"string"},"name":{"label":"目标词条名(优先)","type":"string"},"id":{"label":"消歧数字ID","type":"string"},"text":{"label":"介绍文字","type":"string"}},"format":"inline"}</templatedata>
[[en:Template:接连百度百科]]
</noinclude>
[[fr:Template:接连百度百科]]
[[ja:Template:接连百度百科]]
[[ko:Template:接连百度百科]]
<templatedata>{"description": "百度百科 link card", "params": {"1": {"label": "Target / label", "type": "string"}, "2": {"label": "Label / target", "type": "string"}, "text": {"label": "Introduction", "type": "string"}, "name": {"label": "Target title", "type": "string"}, "id": {"label": "Disambiguation ID", "type": "string"}}, "format": "inline"}</templatedata></noinclude>