Help:Labeled Section Transclusion
![]() |
You need to use Enhanced editor, not VisualEditor when adding or editing LST. |

Labeled Section Transclusion (LST) allows you to show part of the contents of one page in one or more places across the wiki. This allows editors to maintain content in one place. If the content was copied instead of using LST, a single change to the original text could require numerous edits around the wiki to fix it in all the places it was copied.
LST is different than traditional transclusion in that allows a specific section of a page to be shown other places, rather than an entire page. In short, it is a specialized form of a template.
Documentation
|
Mediawiki's Labeled Section Transclusion contains the full range of options available with this extension.
Best practice usage within USApedia
The Labeled Section Transclusion extension provides two primary mechanisms which needed to be done in Enhanced editor (not VisualEditor) for transcluding information:
- Using section section heads. Examples
- {{#lsth:YouTube|Embedding videos}} will transclude the "Embedding videos" section.
- {{#lsth:YouTube}} will transclude the introduction (the info above the first section head).
- Adding section tags to relevant parts of a document. Example:
- <section begin=givethesectionaname /> what do you want to include <section end=givethesectionaname /> in the source page documents what is to be transcluded
- {{#lst:articleX|givethesectionaname}} would then be used to call that section and transclude it to the location of your choice.
The lead Gardener recommends using the section head approach to help keep the edit window as clean as possible on all related pages. This approach is not without drawbacks, namely if the section head changes, the transclusion will break, but we feel this is the most pragmatic approach.
Example: Test Transclude the intro of YouTube}
{{#lsth:YouTube}}
![]() |
This page in a nutshell: Video-sharing and social media platform owned by Google |
Type of business | Subsidiary |
---|---|
Type of site | Online video platform, Social media platform |
Founded | February 14, 2005 |
Headquarters | 901 Cherry Avenue San Bruno, California, United States |
Area served | Worldwide (excluding blocked countries) |
Owner | Google LLC |
Industry | Video hosting service |
Parent | Google LLC (2006–present) |
URL | youtube.com/ |
Content license | Uploader holds copyright (standard license); Creative Commons can be selected. |
YouTube is an American social media and online video sharing platform owned by Google. Headquartered in San Bruno, California, United States, it is the second-most visited website in the world, after Google Search. In January 2024, YouTube had more than 2.7 billion monthly active users, who collectively watched more than one billion hours of videos every day.[1] As of May 2019[update], videos were being uploaded to the platform at a rate of more than 500 hours of content per minute,[2][3] and as of 2023[update], there were approximately 14 billion videos in total.[4]
On the 9th of October 2006, YouTube was purchased by Google for $1.65 billion[5] Google expanded YouTube's business model of generating revenue from advertisements alone, to offering paid content such as movies and exclusive content produced by and for YouTube. It also offers YouTube Premium, a paid subscription option for watching content without ads. YouTube incorporated Google's AdSense program, generating more revenue for both YouTube and approved content creators. In 2023, YouTube's advertising revenue totaled $31.7 billion, a 2% increase from the $31.1 billion reported in 2022.[6] From Q4 2023 to Q3 2024, YouTube's combined revenue from advertising and subscriptions exceeded $50 billion.[7]
Since its purchase by Google, YouTube has expanded beyond the core website into mobile apps, network television, and the ability to link with other platforms. Video categories on YouTube include music videos, video clips, news, short and feature films, songs, documentaries, movie trailers, teasers, TV spots, live streams, vlogs, and more. Most content is generated by individuals, including collaborations between "YouTubers" and corporate sponsors. Established media, news, and entertainment corporations have also created and expanded their visibility to YouTube channels in order to reach greater audiences.
YouTube has had unprecedented social impact, influencing popular culture, internet trends, and creating multimillionaire celebrities. Despite its growth and success, the platform has been criticized for its facilitation of the spread of misinformation and copyrighted content, routinely violating its users' privacy, excessive censorship, promoting far-right content, endangering the safety of children and their well-being, and for its inconsistent implementation of platform guidelines.
Transcluding sections by headings
There is optional support for transcluding sections of text marked with the normal headings, i.e. ==this section==
. If installed, this is done with the lsth function. This is not currently enabled on wikisource or Meta.
Transclude the introduction
To transclude the introduction of a page (i.e. the content before the first heading), use
{{#lsth:pagename}}
Transclude a specific section
You can also transclude the whole content of the sectionX (which includes all its sub-sections but excludes the heading of sectionX itself).
{{#lsth:pagename|sectionX}}
Things to note:
- Only the first occurrence of the sectionX is transcluded if you have more than one section with the same name.
- Make sure you type what the heading of sectionX is in wiki code, not how it is displayed. For example if the heading of the section is
==List of [[Extension]]==
, you should type "List of [[Extension]]
" not "List of Extension
". - The matching is case insensitive, to prevent links from breaking due to case changes.
Transclude multiple sections
You can also transclude from the first occurrence of sectionX (excluding the heading of sectionX itself) until it reaches the next occurrence of sectionY. Note that sectionY acts as a stop point so the transclusion doesn't contain the content of sectionY.
{{#lsth:pagename|sectionX|sectionY}}
Explicitly marking content to be transcluded
Step 1: Mark off sections
Mark off sections in the text using <section> tags like this:
<section begin=chapter1 />this is a chapter<section end=chapter1 />
Note that this uses two individual markers, rather than normal XML open/close tags, which simplifies nested or overlapping sections. This allows you to insert section tags without worrying about interfering with other sections.
Step 2a: Transclude the section
Call the parser function #lst to transclude it, i.e. to transclude a section called chapter1 from a page called articleX:
{{#lst:articleX|chapter1}}
The target article defines the location of the section; its behavior is determined by the parser function.
Step 2b: Transclude the page but excluding the section
To transclude a page, but exclude a specified section, use the #lstx function:
{{#lstx:articleX|chapter1}}
Optionally, you may add replacement text to the excluded section.
{{#lstx:articleX|chapter1|replacement_text}}
Example:
{{#lstx:articleX|chapter1|See chapter 1 in [[articleX]].}}
The replacement text will appear in the area where the section is skipped (excluded).
Example: Transclude a specific section of YouTube
{{#lsth:YouTube|Embedding videos}}
Limitations
Labeled Section Transclusion appears to ignore noinclude (<noinclude></noinclude>
). Please keep this in mind when using it.
External links
Example uses on other wikis
The Wikimedia foundation is using this function to create an elegant process for status updates. See:
- Mediawikiwiki:Visual editor as an example of tracking status (see its status page).
This process uses the following templates to make it all work (we think this is all of them):
- Mediawikiwiki:Template:Wikimedia project status line
- Mediawikiwiki:Template:Wikimedia project status line/blue link
- Mediawikiwiki:Template:Wikimedia project status line/red link
- Mediawikiwiki:Template:LST section begin
- Mediawikiwiki:Template:close tag
- Mediawikiwiki:Template:LST section end
- Mediawikiwiki:Template:close tag
The status history for each project is maintained in a subpage. In this example, it is at Mediawikiwiki:Visual editor/status
- ↑ Goodrow, Cristos (February 27, 2017). "You know what's cool? A billion hours" (in en-US). https://blog.youtube/news-and-events/you-know-whats-cool-billion-hours.
- ↑ Loke Hale, James (May 7, 2019). "More Than 500 Hours Of Content Are Now Being Uploaded To YouTube Every Minute". TubeFilter (Los Angeles, CA). https://www.tubefilter.com/2019/05/07/number-hours-video-uploaded-to-youtube-per-minute/.
- ↑ Neufeld, Dorothy (January 27, 2021). "The 50 Most Visited Websites in the World" (in en-US). https://www.visualcapitalist.com/the-50-most-visited-websites-in-the-world/.
- ↑ McGrady, Ryan (2024-01-26). "What We Discovered on 'Deep YouTube'" (in en). https://www.theatlantic.com/technology/archive/2024/01/how-many-videos-youtube-research/677250/.
- ↑ Hooker, Lucy (February 1, 2016). "How did Google become the world's most valuable company?" (in en-GB). BBC News. https://www.bbc.com/news/business-35460398.
- ↑ "Alphabet Q1 2024 Earnings Release". https://abc.xyz/assets/91/b3/3f9213d14ce3ae27e1038e01a0e0/2024q1-alphabet-earnings-release-pdf.pdf.
- ↑ "Google CFO Discusses YouTube's Advertising and Subscription Revenue". https://www.businessinsider.com/google-cfo-analysts-ai-subscription-growth-2024-9.