MediaWiki Suggested Configuration: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| Line 8: | Line 8: | ||
</div> | </div> | ||
</pre> | </pre> | ||
*Edit Template:Subpages/doc | |||
<pre> | |||
{{documentation subpage}} | |||
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> | |||
===Usage=== | |||
<tt><nowiki>{{subpages}}</nowiki></tt> shows all the subpages of a given page. It should not be used in the main namespace, only on pages such as user pages, Wiktionary pages and appendices. It takes one, optional parameter, the target page name. The default is <nowiki>{{PAGENAME}}</nowiki> | |||
* <tt><nowiki>{{subpages}}</nowiki></tt>: shows the subpages for the current page (in this case, Template:subpages) | |||
* <tt><nowiki>{{subpages|User:Example}}</nowiki></tt>: shows the subpages for [[User:Example]] | |||
== Alternative == | |||
You can also embed the [[Special:PrefixIndex]] directly, e.g. | |||
<code><nowiki>{{Special:Prefixindex|prefix=User:Example/|hideredirects=1|stripprefix=1}}</nowiki></code> | |||
If you want use in your wiki a sorted lists of subpages, or get counts of it for using in templates, you may try extension [[Extension:SubPageList]]. Example using of this, see wiki code of template [https://www.thewoodcraft.org/wiki/index.php?title=%C5%A0ablona:pages&action=edit Template:pages]. It's alternative solution without tag <code><pages></code> for pages of books from the [[Extension:ProofreadPage]]. This template generate i.e. content of page [https://www.thewoodcraft.org/wiki/index.php/The_Birch-Bark_Roll_1906_(kniha) The Birch-Bark Roll 1906 (kniha)]. It is solution '''without''' dependency on the [[Lua]] modules. | |||
<includeonly> | |||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> | |||
[[fr:Modèle:sous-pages]] | |||
</includeonly> | |||
</pre> | |||
=References= | =References= | ||
Revision as of 06:53, 20 October 2020
LocalSettings.php
- Enable Subpages, because they are awesome<ref>have subpages, https://www.mediawiki.org/wiki/Help:Subpages</ref><ref>list all subpages, https://www.mediawiki.org/wiki/Topic:Ua1cqlfd07kyvd8p</ref>
$wgNamespacesWithSubpages[NS_MAIN] = true;
- Edit Template:Subpages
<div style="font-size:100%>
{{Special:Prefixindex/{{{1|{{BASEPAGENAMEE}}|{{FULLPAGENAMEE}} }}}/}}
</div>
- Edit Template:Subpages/doc
{{documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
===Usage===
<tt>{{subpages}}</tt> shows all the subpages of a given page. It should not be used in the main namespace, only on pages such as user pages, Wiktionary pages and appendices. It takes one, optional parameter, the target page name. The default is {{PAGENAME}}
* <tt>{{subpages}}</tt>: shows the subpages for the current page (in this case, Template:subpages)
* <tt>{{subpages|User:Example}}</tt>: shows the subpages for [[User:Example]]
== Alternative ==
You can also embed the [[Special:PrefixIndex]] directly, e.g.
<code>{{Special:Prefixindex|prefix=User:Example/|hideredirects=1|stripprefix=1}}</code>
If you want use in your wiki a sorted lists of subpages, or get counts of it for using in templates, you may try extension [[Extension:SubPageList]]. Example using of this, see wiki code of template [https://www.thewoodcraft.org/wiki/index.php?title=%C5%A0ablona:pages&action=edit Template:pages]. It's alternative solution without tag <code><pages></code> for pages of books from the [[Extension:ProofreadPage]]. This template generate i.e. content of page [https://www.thewoodcraft.org/wiki/index.php/The_Birch-Bark_Roll_1906_(kniha) The Birch-Bark Roll 1906 (kniha)]. It is solution '''without''' dependency on the [[Lua]] modules.
<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[fr:Modèle:sous-pages]]
</includeonly>