◆少前百科是非盈利性、非官方的少女前线维基百科。 ◆如果您发现某些内容错误/空缺,请勇于修正/添加!参与进来其实很容易!点这里 加入少前百科。 ◆有任何意见、建议、纠错,欢迎在 GFwiki:反馈与建议 提出和讨论。编辑事务讨论QQ群:597764980,微博@GFwiki少前百科 ◆To foreigners,You can use twitter to contact us. |
“模板:子页面列表”的版本间的差异
小 (已保护“模板:子页面列表”([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期))) |
Mikumikuer(讨论 | 贡献) |
||
第3行: | 第3行: | ||
| val | | val | ||
| "{{#var:val|}}", | | "{{#var:val|}}", | ||
− | }}]}}</includeonly> | + | }}]|{{#if{{{排序|}}}|sortNum=1|}}</includeonly> |
<noinclude>{{documentation}}[[category:模板]]</noinclude> | <noinclude>{{documentation}}[[category:模板]]</noinclude> |
2020年8月27日 (四) 16:57的版本
作用:获取当前主页面的所有子页面,并且显示在标题后
使用方法
说明:"excludex="为排除指定的子页面(只需要输入子页面全称,可输入99组,x为数字(1-99)),剩余的子页面会自动获取,列表将显示在标题后
1、不适用于有命名空间的对象,只能在主命名空间内使用(即不适用于模板: Widget:等页面)
2、必须要在页面第一行顶头写!
3、排除的子页面名称大小写要对应。
运行所需依赖
如果需要导出该模板,需要以下插件、Widget
- Widget:子页面列表(连同模板页一起导出)
- Extension:Loops(所需插件)
- 复制以下代码加入Wiki头部元素
<script type="text/javascript">
var addCssRule = function() {
function createStyleSheet() {
var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style');
style.type = 'text/css';
head.appendChild(style);
console.dir(style)
return style.sheet ||style.styleSheet;
}
var sheet = createStyleSheet();
return function(selector, rules, index) {
index = index || 0;
if (sheet.insertRule) {
sheet.insertRule(selector + "{" + rules + "}", index);
} else if (sheet.addRule) {
sheet.addRule(selector, rules, index);
}
}
}();