Help:Transclusion
This page in a nutshell: Transclusion is a way to use content from one article, on another article without having to copy the content from one to the other. If the original content is changed, the change will automatically show in the article that is using the trancluded content. |
|
Transclusion means the inclusion of the content of one document in another document by reference. In USApedia, it refers to a function of the MediaWiki software that allows the content of one page to be included in the content of another page, by placing a reference to the source page in the wikitext of the target page. A page that is intended to be transcluded into other pages is called a template. Changes made to a template are automatically reflected on all pages into which that template has been transcluded.
In addition to templates, it is possible to share portions of a page using Labeled Section Transclusion.
Templates
Templates are the main way in which transclusion occurs on USApedia, often with the use of Navboxes and Infoboxes.
Noinclude, includeonly, and onlyinclude
The info is from Help:Templates#Noinclude,_includeonly,_and_onlyinclude
abc def
Labeled Section Transclusion
Labeled Section Transclusion allows the transclusion of a specific section of a page rather than an entire page.
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 |
Lua error in Module:Effective_protection_level at line 93: attempt to call local 'p' (a table value). Lua error in Module:Effective_protection_level at line 93: attempt to call local 'p' (a table value).
YouTube is an American social media and online video sharing platform owned by Google. YouTube was founded on February 14, 2005, by Steve Chen, Chad Hurley, and Jawed Karim, three former employees of PayPal. 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 (equivalent to $Expression error: Unrecognised punctuation character "[". billion in Template:Inflation year).[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.
How Transclusion Works
To transclude any source page (within a single MediaWiki project, such as en:Wikipedia), use the following code in the target page:
{{SOURCEPAGE}}
Any time you write the code ({{SOURCEPAGE}}
) in a target page, you are telling Wikipedia software to put the entire content of SOURCEPAGE
in the target page.
In the example below, look at target page A and SOURCEPAGE
B.
If B is transcluded in A, Wikipedia software will include in that specific place not the code ({{B}}
) itself but the content of source page B (which is just the word foo).
The top row shows how target pages A, P, and Q will look with the changes in code seen in the bottom row to transclude source page B. Note the position of the code in each example target page.
The source page content, foo, will not be highlighted or boxed on the target page. (Foo is in a light blue box here for ease of illustration and understanding.)
Transclusion creates a "live" link between a source page and the target page(s) where the source page's contents appear. This means that when you edit a source page, you will be updating its content across all the target pages that include it. Let's say you create a source page in Wikipedia with the address, date, and time of a local Wikimedia event that you want to invite 50 local editors to. Next, you transclude the invitation source page onto your talk page as well as the talk pages of the other 50 editors. A week later you discover the place for the event must be moved. You would then update the source page, and the new address will automatically appear on all the other attendees' talk pages. You could also tell the editors to invite people you may have missed. They could then simply transclude the invitation source page into other editors' talk pages themselves.
Remember to be extremely careful about editing any source page, especially if it contains transclusions from other source pages. Breaking existing transclusions in a source page is called breakage. Please avoid breakage(s) because not only the larger source page you are editing and all the target pages that include it will be affected. So will both the already embedded (now broken) source page that was used to add content to the larger source page, as well as every target page where the embedded source page was transcluded.
See also
If this page has been recently modified, it may not reflect the most recent changes. Please purge this page to view the most recent changes. |
- ↑ 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.