在维基主页上调用随机文章

时间:2012-10-19 02:50:57

标签: random call mediawiki wiki article

我有一个食谱维基,想在主页上放一个“随机食谱”。 希望你能帮帮我。

我看维基媒体的帮助,但没有发现任何问题 http://www.mediawiki.org/w/index.php?title=Special%3ASearch&profile=advanced&search=random+article&fulltext=Search&ns90=1&redirs=1&profile=advanced

这是我正在努力的维基 http://lesmots.uy/labs/enciclochef

由于

1 个答案:

答案 0 :(得分:0)

我相信你正在寻找Extension:ArticleInclude。它允许您使用Wiki上的任何随机文章覆盖包含的文章名称。它还允许您限制长度,以便您只看到该文章的片段。

出于您的目的,我想象食谱标题和/或成分就足够了。包含这些成分可能会很棘手,因为您以简单的列表格式将它们列在页面顶部。如果您选择使用ArticleInclude扩展,我建议您将您的成分保存在一行中,并使用HTML创建换行符,以便您可以使用lines选项来可靠地获得所需内容。

示例,改编自Torta aromática

<blockquote> 3 huevos <br> 3 cucharadas de leche <br> 6 cucharadas de manteca derretida <br> 1 ½ tazas de harina <br> ¾ tazas de azúcar <br> 2 cucharaditas de polvo de hornear <br> 2 cucharaditas de canela <br> ¼ cucharadita de clavo de olor molido <br> ½ cucharadita de cáscara de limón rallada </blockquote>

相关选项:

random: Overides article and shows a random article of the given namespaces
count: How many letters will be shown, negative values will display the whole article removing the specific number of letters from the end
lines: Count lines (not letters) that will be shown

编辑:如果您不想使用扩展程序,Transclusion自MediaWiki 1.8以来就开箱即用,但没有随机文章功能。您可能已经在新用户对话页面上看到过移植操作,其中许多wiki通常会链接到一个页面,为新用户提供有用的建议。

相关问题