Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Help:Transclusion
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Standard section transclusion=== {{notice|text='''This method may cause line break insertion:''' Standard section transclusion may introduce a leading or trailing [[Line break (computing)|line break]] or newline, depending on the markup in the source and target pages. To prevent this, [[Wikipedia:Wrapper templates|wrap]] the transclusion code in a {{tlc|trim}} template. See [[#prevent line break insertion|examples below]].}} Standard section transclusion uses <syntaxhighlight lang="wikitext" inline>{{#section-h:PAGENAME|SECTIONNAME}}</syntaxhighlight>. One can easily transclude the content within a section from one page to another using the ubiquitous headline-based [[Help:Section|section headers]] used throughout Wikipedia. To transclude the [[Wikipedia:Lead|lead]] section of an article with this method, one can use {{nowrap|<syntaxhighlight lang="wikitext" inline>{{#section-h:PAGENAME}}</syntaxhighlight>}}. This method is simpler than other selective transclusion methods, which require special [[Wikipedia:Markup|markup]] in the source article or page to specify what content should be included or excluded. {{anchor|prevent line break insertion}}Standard section transclusion may introduce a leading or trailing [[Line break (computing)|line break]] or newline, depending on the markup in the source and target pages. To prevent this, [[Wikipedia:Wrapper templates|wrap]] the transclusion code in a {{tlx|trim}} template. For example: * To transclude the section of an article: <syntaxhighlight lang="wikitext" inline>{{trim|{{#section-h:PAGENAME|SECTIONNAME}}}}</syntaxhighlight> * To transclude the lead of an article: <syntaxhighlight lang="wikitext" inline>{{trim|{{#section-h:PAGENAME}}}}</syntaxhighlight> <!-- This warrants expansion (better formatting, examples), but I'm creating the section for now - to see what the initial feeback is. -Elvey)--> ====Hatnote on the target page==== To indicate on the {{em|target page}} where selectively transcluded content originates (its source), a {{tlx|Transcluded section}} [[Wikipedia:Hatnote|hatnote]] must be placed at the top of the corresponding section in the {{em|target page}} where the content is being transcluded {{em|to}}.{{refn|group=lower-alpha|No hatnote should be placed on the {{em|source page}}, in other words no hatnote is needed on the page being transcluded {{em|from}}, as readers do not need to know where else the content appears.}}{{refn|group=lower-alpha|That is the hatnote should be placed below the header but above the content, per [[MOS:Layout]].}} Use either of the following, depending on whether the transcluded content is the entire section or only part of it: * If an entire section in the target page is transcluded the source: <syntaxhighlight lang="wikitext" inline>{{transcluded section|source=PAGENAME#SECTION}}</syntaxhighlight>, which renders as: :{{transcluded section|source=PAGENAME#SECTION}} * If only part of a section in the target page is transcluded the source, specify {{para|part|yes}}: <syntaxhighlight lang="wikitext" inline>{{transcluded section|source=PAGENAME#SECTION|part=yes}}</syntaxhighlight>, which renders as: :{{transcluded section|source=PAGENAME#SECTION|part=yes}} ====Hidden comment on the source page==== It is recommended to include a [[Wikipedia:Manual of Style/Hidden text|hidden comment]] at the beginning of the transcluded section in the {{em|source page}}. This comment informs editors that the content is being used elsewhere and serves as a reminder to consider the broader audience when modifying the wording. Additionally, it helps maintain the integrity of the transcluded material on the target page. For example (replace {{mono|<nowiki>[[PAGENAME#SECTION]]</nowiki>}} with the name of the target page): {{Talk quote block minimalist|{{Example HTML comment|The content of this section is transcluded to <syntaxhighlight lang="wikitext" inline>[[PAGENAME#SECTION]]</syntaxhighlight>. Please be aware that changes made to the original source here will affect the transcluded version on the target page mentioned.}}}} '''No hatnote should be placed on the {{em|source page}}''', in other words no hatnote is needed on the page being transcluded {{em|from}}, as readers do not need to know where else the content appears.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)