打开主菜单
少前百科GFwiki
β
搜索
查看“模板:子页面列表/doc”的源代码
←
模板:子页面列表/doc
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
自动确认用户
您可以查看与复制此页面的源代码。
作用:获取当前主页面的所有子页面,并且显示在标题后 ==使用方法== <div style="padding:1em;display:inline-block;background:white;border:1px solid #aaa;color:#333;width:auto;"><nowiki>{{子页面列表|特殊=1(主页面包含“/”(半角斜杠)时,在主页填此项)|exclude</nowiki><sub>x</sub>=|...}}</div> 说明:"exclude<sub>x</sub>="为排除指定的子页面(只需要输入子页面全称,可输入99组,<sub>x</sub>为数字(1-99)),剩余的子页面会自动获取,列表将显示在标题后<BR> <div style="font-weight:bold;color:red;">注意: <p style="font-weight:bold;color:red;">1、不适用于有命名空间的对象,只能在主命名空间内使用(即不适用于模板: Widget:等页面)</p> <p style="font-weight:bold;color:red;">2、必须要在页面第一行顶头写!</p><p style="font-weight:bold;color:red;">3、排除的子页面名称大小写要对应。</p></div> ==运行所需依赖== 如果需要[http://www.gfwiki.org/index.php?title=special:export 导出]该模板,需要以下插件、Widget *[http://www.gfwiki.org/index.php?title=Widget:子页面列表 Widget:子页面列表](连同模板页一起导出) *[http://www.mediawiki.org/wiki/Extension:Loops Extension:Loops](所需插件) *复制以下代码加入Wiki头部元素 <div style="padding:1em;display:block;background:white;border:1px solid #aaa;color:#333;width:auto;"><script src="//upcdn.b0.upaiyun.com/libs/jquery/jquery-2.0.3.min.js"></script> <nowiki><script type="text/javascript"></nowiki><BR> var addCssRule = function() {<BR> function createStyleSheet() {<BR> var head = document.head || document.getElementsByTagName('head')[0];<BR> var style = document.createElement('style');<BR> style.type = 'text/css';<BR> head.appendChild(style);<BR> console.dir(style)<BR> return style.sheet ||style.styleSheet;<BR> }<BR> var sheet = createStyleSheet();<BR> return function(selector, rules, index) {<BR> index = index || 0;<BR> if (sheet.insertRule) { <BR> sheet.insertRule(selector + "{" + rules + "}", index); <BR> } else if (sheet.addRule) { <BR> sheet.addRule(selector, rules, index); <BR> }<BR> }<BR> }();<BR> <nowiki></script></nowiki><BR></div>
返回至
模板:子页面列表/doc
。