User:Trialpears/Section Transclusion

From Wikipedia, the free encyclopedia

Section transclusion, also known as Labeled Section Transclusion (LST), is a method to automatically include content from one page on another. This is most commonly used to include tables or summaries from one article in one or a few related articles. This is different from using templates in that it does not require a separate page to be created, and adding a single template to the page you want to include the content in is usually enough.

The main benefit of using section transclusion rather than templates is that the content that is used on several articles can be modified while editing the article like normal and does not require you to open a different page. The drawback to this is that normal edits to one (source) article can break a section transclusion on a different page if the content is used there. This happens if the heading for the transcluded part changes or the page is moved and the other page isn't updated. When this occurs a bot will try to fix it, but if it's unsuccessful it will instead notify the editor that accidentally broke it and explain how to fix the issue.

Create section transclusion[edit]

To transclude a section you use the template {{Section transclusion|source page|section label}} on the target page. This copies the content from the specified page and section into the article. The section label can either be an existing section header or, preferably, be specified by putting {{Section transclusion start|label}} and {{Section transclusion end|label}} around the content you want to copy. Doing it this way makes it clear that content from the article is used in several places and highlights this fact in preview mode. If an existing heading is used the risk of it being changed is significant, which will cause the transclusion to break.

Technical information[edit]

These templates are used only on English Wikipedia and do not work on other wikis. For a more technical explanation covering the underlying MediaWiki feature Labeled Section Transclusion and other methods to include content from one page in another please see the documentation at MediaWiki wiki or Help:Section transclusion/Advanced.

Organizational concerns[edit]

Any form of selective transclusion is only sometimes appropriate, and requires careful judgement. Only content that is organizationally stable within an article should be considered as a candidate for transclusion. If there is a meaningful chance that the content in the source article could be rearranged in such a way that the portion that is marked for transclusion would not be a cohesive unit anymore, would be drastically altered in other ways, or even removed, attempting to transclude that content (or probably any content from any such article) may be a bad idea, as there is a high probability that the relationship between the articles will be upset, breaking the transclusion – or – that transclusion will produce something fundamentally different from the originally intended result.

Longstanding articles that are assessed as being of a high quality, and haven't seen layout changes in a long time, are much better candidates for transclusion than newer and more fluid articles. Longstanding, complete, well laid-out, lists that are historical in scope, and are therefore unlikely to significantly change, are likely to be good candidates.

See also[edit]