在哪里可以获得MediaWiki的模板? [英] Where can I get templates for MediaWiki?

查看:284
本文介绍了在哪里可以获得MediaWiki的模板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到很多基于MediaWiki的网站都使用Robelbox,Ambox等模板.在哪里可以找到它们以及如何安装?

解决方案

这是 PITA ,不幸的是(与扩展名或媒体文件不同),没有罐头模板的存储库.模板会加载其他模板,这些模板又会依次加载其他模板,等等.

转到Wikipedia并复制您想要的模板的名称,转到Special:Export并将模板的名称粘贴在大文本框中,例如模板:信息框.选中包括模板",然后选中仅包括当前修订版本,不包括完整历史记录"(否则文件太大).单击导出以转储模板的.xml文件.然后将其导入到目标Wiki.

导入后,打开模板进行编辑,检查编辑框该页面的当前版本所包含的页面:"下面的列表.如果有任何红色链接,请对这些模板重复上述步骤.在一切正常之前,您可能还需要在MediaWiki:Common.css页面中复制样式,并在MediaWiki:Common.js中复制Javascript.最后,编辑模板以针对您的Wiki进行自定义.

如果仍然无法使用,并且您的括号和if语句页面混乱,则需要安装 ParserFunctions 扩展名.如果模板代码中包含{{#invoke: }},则还需要安装 Scribunto扩展.

MediaWiki Help:Templates 详细说明了该过程.

I have noticed that a lot of mediawiki-based websites use such templates as Robelbox, Ambox etc. Where can I get them and how should they be installed?

解决方案

It's a PITA and unfortunately (unlike extensions or media files) there is no repository of canned templates. Templates load other templates which load others in turn, etc.

Go to Wikipedia and copy the name of the template you're after, go to Special:Export and paste the name of the template in the big text box, e.g. Template:Infobox. Check "Include templates" and check "Include only the current revision, not the full history", (or the file will be too big). Click Export to dump a .xml file of the template. Then import this into the destination wiki.

After it has been imported open the template for editing, check the list below the edit box "Pages transcluded onto the current version of this page:". If there are any red links repeat the above steps for these templates as well. You might also need to copy styles in MediaWiki:Common.css page and Javascript in MediaWiki:Common.js before everything works. Finally edit the templates to customize for your wiki.

If it still doesn't work and you have messy pages of braces and if statements, then you need to install the ParserFunctions extension. If there is {{#invoke: }} in template code you'll also need to install the Scribunto extension.

MediaWiki Help:Templates explains the process in more detail.

这篇关于在哪里可以获得MediaWiki的模板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆