Template:Transclude random subpage/doc
| This is a documentation subpage for Template:Transclude random subpage. It may contain usage information, categories and other content that is not part of the original template page. |
| This template uses Lua: |
This template pulls in the content of one sub-subpage randomly chosen from a set of numerically-named sub-subpages. Designed primarily for use on portals.
Usage
Default
{{Transclude random subpage
|max =
|subpage =
}}
Full
{{Transclude random subpage
|max =
|subpage =
|rootpage =
|several =
|prefix =
|more =
|leftfooter =
|rightfooter =
}}
Parameters
|max=- The maximum number of sub-subpages. Must be a positive integer.
|subpage=- The subpage of the root that is the parent of the transcluded sub-subpages, e.g. Selected article.
|rootpage=- (Optional) The root of the transcluded page, that is, the page the transclusion takes place on. e.g. Portal:Foo.
|several=- (Optional) specify how many subpages are to be transcluded, default is one.
|prefix=- optional prefix to prepend to every transcluded subpage. E.g. use
|prefix=*to generate an unordered list. |more=- (Optional) link text for a wikilink under transcluded page in the right footer.
|leftfooter=- optional left footer.
|rightfooter=- optional right footer.
Examples of usage of almost all parameters can be seen in Portal:Mathematics/Did you know and Portal:Doctor Who.
Setting up the subpage, and the sub-subpages
- Create the subpage first. If your portal is
Portal:Foo, then the subpage could bePortal:Foo/Selected bar. - On the subpage (in this case,
Portal:Foo/Selected bar), place the template{{numbered subpages}}on that page and save it. - Create subpages for that subpage, naming them /1, /2, /3, etc., and on each one, copy/paste the content you wish to transclude. In this example, that would be a description of a different bar (tavern) lifted from an article about a bar, for each numerical page.
To see an example, see Portal:Psychiatry -- it uses this template and a corresponding subpage scheme.
Why this template?
This template was created to enable {{Random portal component}} to be replaced with standard portal box notation, including {{Box-header colour}} and {{Box-footer}}.
Example:
{{Random portal component|max=22|header=Selected article}}
could be replaced by this:
{{Box-header colour|Selected article}}
{{Transclude random subpage |max=22|subpage=Selected article}}
{{Box-footer}}
This also allows a box to be modified (edited) independently of its contents, and to match the other boxes on the page.
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.