Editing Guide/Patterns: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
Line 14: | Line 14: | ||
* Make sure the subpage makes sense if someone comes to it via categories and reads it as a separate page. | * Make sure the subpage makes sense if someone comes to it via categories and reads it as a separate page. | ||
** Use <code><<nowiki />noinclude></code> tags to add parts that won't be included into the parent page if they are redundant there. Example: the Joeism banner on [[Japanese_Mispronunciations/Sun_Deer]]. | ** Use <code><<nowiki />noinclude></code> tags to add parts that won't be included into the parent page if they are redundant there. Example: the Joeism banner on [[Japanese_Mispronunciations/Sun_Deer]]. | ||
** You can even include parts of the parent page into the subpage, e.g: wrap <code><<nowiki />section begin="section_name" /><<nowiki />section end="section_name" /></code> around a section then <code>{<nowiki />{#lst:Parent|section}}</code> will include that section into the child page (of course make sure this is wrapped in <code><<nowiki />noinclude></code> tags). Example: the explanation on [[Japanese_Mispronunciations/Sun_Deer]]. | ** You can even include parts of the parent page into the subpage, e.g: wrap <code><<nowiki />section begin="section_name" />...<<nowiki />section end="section_name" /></code> around a section then <code>{<nowiki />{#lst:Parent|section}}</code> will include that section into the child page (of course make sure this is wrapped in <code><<nowiki />noinclude></code> tags). Example: the explanation on [[Japanese_Mispronunciations/Sun_Deer]]. | ||
* If the parent article needs context for the subpage, you can use <code><<nowiki />includeonly></code> tags to have parts that don't appear when you are on the subpage itself, like a subtitle for the section. Example: the title on [[Japanese_Mispronunciations/Sun_Deer]]. | * If the parent article needs context for the subpage, you can use <code><<nowiki />includeonly></code> tags to have parts that don't appear when you are on the subpage itself, like a subtitle for the section. Example: the title on [[Japanese_Mispronunciations/Sun_Deer]]. | ||
* If making links to the section/subpage, use <code>{<nowiki />{EmbeddedSubpageLink|Parent|Subpage}}</code> to link to it, this will link to the section, unless you are *on* the subpage, where it'll be a self-link. This makes it work nicely in navboxes and the like where you want it to be a self-link for clarity they are on that page. | * If making links to the section/subpage, use <code>{<nowiki />{EmbeddedSubpageLink|Parent|Subpage}}</code> to link to it, this will link to the section, unless you are *on* the subpage, where it'll be a self-link. This makes it work nicely in navboxes and the like where you want it to be a self-link for clarity they are on that page. |
Revision as of 17:56, 25 January 2025
Embedded Subpages
In some situations you have something which is small enough it should really just be a section of a larger article, but also it is distinct enough it should really have its own categories, without them all being mixed into the larger article.
The solution to this is to make a subpage for the item, and include it into the larger page, but it needs to be structured right for this to work.
Examples:
- Outer_Wilds/Outer_Wilds/Echoes_of_the_Eye
- Japanese_Mispronunciations/Japanese Mispronunciations/Saké/Japanese_Mispronunciations/Sun_Deer/etc...
To make this work nicely:
- Include a sub-page into the parent page with simply
{{/Subpage}}
. - Make sure to wrap categories on the subpage in
<noinclude>
tags, otherwise they will get included into the base page. Example: the Yakuza 0 category on Japanese_Mispronunciations/Yazooka, which doesn't make sense on the parent article. - Make sure the subpage makes sense if someone comes to it via categories and reads it as a separate page.
- Use
<noinclude>
tags to add parts that won't be included into the parent page if they are redundant there. Example: the Joeism banner on Japanese_Mispronunciations/Sun_Deer. - You can even include parts of the parent page into the subpage, e.g: wrap
<section begin="section_name" />...<section end="section_name" />
around a section then{{#lst:Parent|section}}
will include that section into the child page (of course make sure this is wrapped in<noinclude>
tags). Example: the explanation on Japanese_Mispronunciations/Sun_Deer.
- Use
- If the parent article needs context for the subpage, you can use
<includeonly>
tags to have parts that don't appear when you are on the subpage itself, like a subtitle for the section. Example: the title on Japanese_Mispronunciations/Sun_Deer. - If making links to the section/subpage, use
{{EmbeddedSubpageLink|Parent|Subpage}}
to link to it, this will link to the section, unless you are *on* the subpage, where it'll be a self-link. This makes it work nicely in navboxes and the like where you want it to be a self-link for clarity they are on that page.