Mgmcharitabletrust (talk | contribs) No edit summary |
|||
Line 1: | Line 1: | ||
<!-- BANNER ACROSS TOP OF PAGE --> |
|||
{{redirect3|WP:TRANS|You may be looking for [[Wikipedia:Transwiki log]], [[Help:Transwiki]], [[Wikipedia:Translation]] or [[Wikipedia:WikiProject Transwiki]]}} |
|||
{| id="mp-topbanner" style="width:100%; background:#f6f6f6; margin-top:1.2em; border:1px solid #ccc;" |
|||
{{shortcut|WP:TRANS}} |
|||
| style="width:61%; color:#000;" | |
|||
'''[[Transclusion]]''' is the inclusion of the content of a document into another document by reference. In the Wikipedian context, it is the use of the [[Wikipedia:Template messages|template functionality]] of [[MediaWiki]] to include the same content in multiple documents without having to edit those documents separately. Template transclusion is the common way to use template messages, and is implemented by using a template tag, with this form below: |
|||
<!-- "WELCOME TO WIKIPEDIA" AND ARTICLE COUNT --> |
|||
:<code><nowiki>{{Template name}}</nowiki></code> |
|||
{| style="width:280px; border:none; background:none;" |
|||
| style="width:280px; text-align:center; white-space:nowrap; color:#000;" | |
|||
Occasionally one may want to use a template, but for one reason or another may not want to use transclusion. The automatic one-time copying of a template's code/text to the location of a template tag is called [[Wikipedia:Substitution|Template substitution]] or subclusion (substitution + transclusion). To subclude a template's code/text, the template tag is modified from the standard transclusion tag to a substitution tag, simply by adding <code>subst:</code>, creating a tag with the form: |
|||
<div style="font-size:162%; border:none; margin:0; padding:.1em; color:#000;">Welcome to [[Wikipedia]],</div> |
|||
:<code><nowiki>{{subst:Template name}}</nowiki></code> |
|||
<div style="top:+0.2em; font-size:95%;">the [[free content|free]] [[encyclopedia]] that [[Wikipedia:Introduction|anyone can edit]].</div> |
|||
<div id="articlecount" style="width:100%; text-align:center; font-size:85%;">[[Special:Statistics|{{NUMBEROFARTICLES}}]] articles in [[English language|English]]</div> |
|||
{{/How Transclusion Works}} |
|||
|} |
|||
<!-- PORTAL LIST ON RIGHT-HAND SIDE --> |
|||
== Etymology == |
|||
| style="width:13%; font-size:95%;" | |
|||
[[Ted Nelson]] coined the term in his 1982 book, ''[[Literary Machines]]''. |
|||
* [[Portal:Arts|Arts]] |
|||
Ted Nelson is also the inventor of the terms "[[hypertext]]" and "[[hypermedia]]". |
|||
* [[Portal:Biography|Biography]] |
|||
* [[Portal:Geography|Geography]] |
|||
==Partial transclusion== |
|||
| style="width:13%; font-size:95%;" | |
|||
By using "noinclude", "onlyinclude" and "includeonly" markup, it is possible to transclude part of a page rather than all of it. Such partial transclusions can also be achieved by transcluding from other pages such as subpages. It is often useful not to transclude some information, such as template documentation. |
|||
* [[Portal:History|History]] |
|||
* [[Portal:Mathematics|Mathematics]] |
|||
For an example of how this technique can be applied to simplify the creation of [[WP:SS|summary articles]], see [http://en.wikipedia.org/w/index.php?title=Pathology&oldid=301684595 this revision of Pathology], which consisted of a collection of transcluded [[WP:LEAD|lead paragraphs]] from several main articles. |
|||
* [[Portal:Science|Science]] |
|||
| style="width:13%; font-size:95%;" | |
|||
{{anchor|Transclusion markup}} <!--Temp anchor |
|||
* [[Portal:Society|Society]] |
|||
until renamed section is checked for link breakage via ''what links here''--> |
|||
* [[Portal:Technology|Technology]] |
|||
===Markup=== |
|||
* '''[[Portal:Contents/Portals|All portals]]''' |
|||
{{also|Help:Template#Noinclude, includeonly, and onlyinclude|Help:Category#Categories_and_templates}} |
|||
|} |
|||
<!-- TODAY'S FEATURED ARTICLE; DID YOU KNOW --> |
|||
There are three pairs of [[html element|tags]] that can be used in [[wikitext]] to control how transclusion affects '''''[[HTML#Elements|elements]]''''' of a template or article. |
|||
{| id="mp-upper" style="width: 100%; margin:6px 0 0 0; background:none; border-spacing: 0px;" |
|||
They determine whether or not wikitext renders, either in its own article, which we will call "'''here'''", or in another article where it is transcluded, which we will call "'''there'''". |
|||
{{#if:{{Main Page banner}}|<tr id="mp-banner"><td colspan="3" style="text-align:center; font-size:100%; background-color:#F2E6CE; padding:0.2em; border:1px solid #BFB1A3; color:#000; font-weight:bold;">{{Main Page banner}}</td></tr> |
|||
*'''<nowiki><noinclude></nowiki>''' this content '''will not be rendered ''there''''' '''<nowiki></noinclude></nowiki>''' . These tags have no effect ''here''. |
|||
}} |
|||
*'''<nowiki><includeonly></nowiki>''' this content '''will render only ''there''''', and will not render ''here'' '''<nowiki></includeonly></nowiki>''' (like [[invisible ink]] made visible by means of transclusion). |
|||
| class="MainPageBG" style="width:55%; border:1px solid #cef2e0; background:#f5fffa; vertical-align:top; color:#000;" | |
|||
*'''<nowiki><onlyinclude></nowiki>''' this content will render ''here'' and will render ''there'' '''<nowiki></onlyinclude></nowiki>''' but '''the rest of the article will be excluded from rendering ''there'''''. |
|||
{| id="mp-left" style="vertical-align:top; background:#f5fffa;" |
|||
There can be several such section ''elements''. Also, they can be nested. All possible renderings are achievable. For example, to render ''there'' one or more sections of the page ''here'' use '''<nowiki><onlyinclude></nowiki>''' tags. To append text ''there'', wrap the addition in '''<nowiki><includeonly></nowiki>''' tags above, within, or below the section. To omit portions of the section, nest '''<nowiki><noinclude></nowiki>''' tags within it. |
|||
! style="padding:2px;" | <h2 id="mp-tfa-h2" style="margin:3px; background:#cef2e0; font-size:120%; font-weight:bold; border:1px solid #a3bfb1; text-align:left; color:#000; padding:0.2em 0.4em;">{{#ifexpr:{{formatnum:{{PAGESIZE:Wikipedia:Today's featured article/{{#time:F j, Y}}}}|R}}>150|Today's featured article|Featured article <small>(Check back later for today's.)</small>}}</h2> |
|||
|- |
|||
As a memory aid insert the phrase ''in transclusion'' between the two words to get "noInTransclusionInclude", "includeInTransclusionOnly" and "onlyInTransclusionInclude". |
|||
| style="color:#000;" | <div id="mp-tfa" style="padding:2px 5px">{{#ifexpr:{{formatnum:{{PAGESIZE:Wikipedia:Today's featured article/{{#time:F j, Y}}}}|R}}>150|{{Wikipedia:Today's featured article/{{#time:F j, Y}}}}|{{Wikipedia:Today's featured article/{{#time:F j, Y|-1 days}}}}}}</div> |
|||
|- |
|||
{{for example|m:template:information thread|the wikitext of the the wiki news thread.}} |
|||
! style="padding:2px" | <h2 id="mp-dyk-h2" style="margin:3px; background:#cef2e0; font-size:120%; font-weight:bold; border:1px solid #a3bfb1; text-align:left; color:#000; padding:0.2em 0.4em;">Did you know...</h2> |
|||
|- |
|||
===Subpages=== |
|||
| style="color:#000;padding:2px 5px 5px" | <div id="mp-dyk">{{Did you know}}</div> |
|||
One can cut and paste the text to be transcluded into a [[Wikipedia:Subpages|subpage]], then use the name of the subpage in the transclusion template. This approach can only be used with subpages from User, Talk or Wikipedia pages; currently, subpages [[Wikipedia:Subpages#Articles do not have sub-pages (main namespace)|cannot be created from main article pages]]. |
|||
|} |
|||
| style="border:1px solid transparent;" | |
|||
Example: you want to discuss the deletion and redirecting of [[Pussycat]] to [[Cat]]. First, create the subpage [[Talk:Pussycat/Let's delete Pussycat!]], write your comment into it, then transclude it in [[Talk:Pussycat]] and [[Talk:Cat]] using the template '''<nowiki>{{Talk:Pussycat/Let's delete Pussycat!}}</nowiki>'''. Comments posted in either talk pages will be shown in both. |
|||
<!-- IN THE NEWS; ON THIS DAY --> |
|||
| class="MainPageBG" style="width:45%; border:1px solid #cedff2; background:#f5faff; vertical-align:top;"| |
|||
===Special pages=== |
|||
{| id="mp-right" style="width:100%; vertical-align:top; background:#f5faff;" |
|||
{{see also|Wikipedia:Special pages#Miscellaneous}} |
|||
! style="padding:2px" | <h2 id="mp-itn-h2" style="margin:3px; background:#cedff2; font-size:120%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">In the news</h2> |
|||
|- |
|||
Some pages on [[Special:Specialpages]] can be transcluded, such as [[Special:Allpages]], [[Special:Prefixindex]], [[Special:Newfiles]], [[Special:Newpages]], [[Special:Recentchanges]] and [[Special:Recentchangeslinked]]. |
|||
| style="color:#000;padding:2px 5px" | <div id="mp-itn">{{In the news}}</div> |
|||
|- |
|||
Samples: |
|||
! style="padding:2px" | <h2 id="mp-otd-h2" style="margin:3px; background:#cedff2; font-size:120%; font-weight:bold; border:1px solid #a3b0bf; text-align:left; color:#000; padding:0.2em 0.4em;">On this day...</h2> |
|||
*<nowiki>{{Special:Allpages/General}}</nowiki> – a list of pages starting at "General" |
|||
|- |
|||
*<nowiki>{{Special:Prefixindex/General}}</nowiki> – a list of pages with prefix "General" |
|||
| style="color:#000;padding:2px 5px 5px" | <div id="mp-otd">{{Wikipedia:Selected anniversaries/{{#time:F j}}}}</div> |
|||
*<nowiki>{{Special:Newfiles/4}}</nowiki> – a gallery of the four most recently uploaded files |
|||
|} |
|||
*<nowiki>{{Special:Newpages/5}}</nowiki> – a list of the five most recently created pages |
|||
|} |
|||
*<nowiki>{{Special:Recentchanges/5}}</nowiki> – the five most recent changes |
|||
<!-- TODAY'S FEATURED PICTURE --> |
|||
*<nowiki>{{Special:Recentchangeslinked/General}}</nowiki> – recent changes to the pages linked from "General" |
|||
{| style="margin:4px 0 0 0; width:100%; background:none; border-spacing: 0px;" |
|||
| class="MainPageBG" style="width:100%; border:1px solid #ddcef2; background:#faf5ff; vertical-align:top; color:#000;"| |
|||
Except for Special:Recentchangeslinked, the slash and the word/number after the slash can be omitted, giving a list of pages without a specific starting point, or a list of the default length. |
|||
{| id="mp-bottom" style="vertical-align:top; background:#faf5ff; color:#000; width:100%" |
|||
! style="padding:2px" | <h2 id="mp-tfp-h2" style="margin:3px; background:#ddcef2; font-size:120%; font-weight:bold; border:1px solid #afa3bf; text-align:left; color:#000; padding:0.2em 0.4em">{{#ifexist:Template:POTD protected/{{#time:Y-m-d}}|Today's featured picture|Featured picture <small>(Check back later for today's.)</small>}}</h2> |
|||
==Pages related to [[MediaWiki]] [[transclusion]]== |
|||
|- |
|||
| style="color:#000;padding: 2px" | <div id="mp-tfp">{{#ifexist:Template:POTD protected/{{#time:Y-m-d}}|{{POTD protected/{{#time:Y-m-d}}}}|{{POTD protected/{{#time:Y-m-d|-1 days}}}}}}</div> |
|||
* [[m:Help:A simple composite example]] |
|||
|} |
|||
* [[Wikipedia:MediaWiki namespace]] |
|||
|} |
|||
** [[m:Help:MediaWiki namespace]] |
|||
<!-- SECTIONS AT BOTTOM OF PAGE --> |
|||
* [[m:Help:Variable]] |
|||
<div id="mp-other" style="padding-top:4px; padding-bottom:2px;"> |
|||
*[[Wikipedia talk:Template namespace#transcluding prose]] |
|||
== Other areas of Wikipedia == |
|||
{{WikipediaOther}} |
|||
==Templates== |
|||
</div><div id="mp-sister"> |
|||
* [[Help:Template]] |
|||
== Wikipedia's sister projects == |
|||
{{WikipediaSister}} |
|||
* [[Wikipedia:Template limits]] |
|||
</div><div id="mp-lang"> |
|||
== |
== Wikipedia languages == |
||
{{Wikipedialang}} |
|||
* [[MediaZilla:4547|Request for template transclusion from Commons]] (interwiki templates, etc.) |
|||
</div> |
|||
* [[Wikipedia:Substitution]] (the opposite of transclusion) |
|||
<!-- INTERWIKI STRAPLINE --> |
|||
{{Main Page interwikis}}__NOTOC____NOEDITSECTION__ |
|||
[[Category:Wikipedia editing]] |
|||
[[Category:Wikipedia templates]] |
|||
[[Category:Wikipedia page help]] |
|||
[[fa:ویکیپدیا:تراگنجانش]] |
|||
[[fr:Wikipédia:Inclusion]] |
|||
[[ko:위키백과:문서 끼워넣기]] |
|||
[[yi:װיקיפּעדיע:אריינשטעלן]] |
|||
[[zh:Wikipedia:嵌入包含]] |
|||
[[pt:Wikipedia:Transclusão]] |
|||
[[simple:Wikipedia:Transclusion]] |
|||
[[pl:Wikipedia:Transkluzja]] |
Revision as of 08:23, 26 June 2010
|
|
|
|
Other areas of Wikipedia
- Community portal – The central hub for editors, with resources, links, tasks, and announcements.
- Village pump – Forum for discussions about Wikipedia itself, including policies and technical issues.
- Site news – Sources of news about Wikipedia and the broader Wikimedia movement.
- Teahouse – Ask basic questions about using or editing Wikipedia.
- Help desk – Ask questions about using or editing Wikipedia.
- Reference desk – Ask research questions about encyclopedic topics.
- Content portals – A unique way to navigate the encyclopedia.
Wikipedia's sister projects
Wikipedia is written by volunteer editors and hosted by the Wikimedia Foundation, a non-profit organization that also hosts a range of other volunteer projects:
-
Commons
Free media repository -
MediaWiki
Wiki software development -
Meta-Wiki
Wikimedia project coordination -
Wikibooks
Free textbooks and manuals -
Wikidata
Free knowledge base -
Wikinews
Free-content news -
Wikiquote
Collection of quotations -
Wikisource
Free-content library -
Wikispecies
Directory of species -
Wikiversity
Free learning tools -
Wikivoyage
Free travel guide -
Wiktionary
Dictionary and thesaurus
Wikipedia languages
This Wikipedia is written in English. Many other Wikipedias are available; some of the largest are listed below.
-
1,000,000+ articles
-
250,000+ articles
-
50,000+ articles