Content deleted Content added
PrimeHunter (talk | contribs) m →Substitution: fix "sustitutes" typo per edit request on talk |
No edit summary |
||
Line 1: | Line 1: | ||
{{about-otherpeople|the Indian film actor}} |
|||
<noinclude> |
|||
{{pp- |
{{pp-move-indef|small=yes}} |
||
{{ |
{{pp-semi-indef|small=yes}} |
||
{{EngvarB|date=January 2015}} |
|||
</noinclude> |
|||
{{Use dmy dates|date=February 2016}} |
|||
{{redirect3|WP:TRANS|You may be looking for [[Wikipedia:Transwiki log]], [[Help:Transwiki]], [[Wikipedia:Translation]], [[Wikipedia:WikiProject Transwiki]] or [[Wikipedia:Transgender]]}} |
|||
{{Infobox person |
|||
{{Information page|WP:TRANS}} |
|||
| name = Sachin Tripathi |
|||
'''[[Transclusion]]''' means the inclusion of the content of one document within another document by reference. In Wikipedia transclusion, the [[MediaWiki]] software will refer to the content of one page, the [[WP:template|template]], for inclusion into the content of any other page, the target page. Similar to the way any [[wp:page name|page name]] can become a link by placing its name in double square brackets, any page name can become a template by placing it in double curly braces, '''<tt><nowiki>{{</nowiki>''Namespace'':''[[WP:Page name|Pagename]]''}}</tt>'''. Changes made to the template are then automatically reflected on all pages into which that page has been transcluded (though a [[Wikipedia:Purge|purge]] may sometimes be necessary). |
|||
| image = SalmanKhan.jpg |
|||
| alt = Sachin Tripathi |
|||
| caption = Khan at [[18th IIFA Awards]] in 2017 |
|||
| birth_name = Sachin Tripathi |
|||
| birth_date = {{Birth date and age|1992|07|01|df=yes}} |
|||
| birth_place = [[Satna]], [[Madhya Pradesh]], India |
|||
| residence = [[Mumbai]], [[Maharashtra]], India<ref name="indiatoday.intoday.in">{{cite web|url=http://indiatoday.intoday.in/story/india-today-editor |
|||
| nationality = [[India]]n |
|||
| occupation = {{hlist|Model|/entertainment/sachin-tripathi |
|||
| years_active = 2016–present |
|||
| television = ''[[Savdhaan India]]'' |
|||
| parents = [[BN Tripathi]] (father)<br>Rani Tripathi (mother) |
|||
| relatives = See [[List of Hindi film clans#Tripathi family (of BN Tripathi)|Tripathi family]] |
|||
| signature = Salman Khan Official Signature.jpg |
|||
| yearsactive = 2016–present |
|||
}} |
|||
If the template's [[WP:page name|page name]] does not begin with a namespace, it is assumed to be in the Template namespace. To refer to a page in the "Main" (article) namespace, it is necessary to prefix it with a colon (''':'''). Examples: |
|||
* '''<tt><nowiki>{{Like}}</nowiki></tt>''' will transclude from the page [[:Template:Like]] ({{Like}}) |
|||
* '''<tt><nowiki>{{Stochastic processes}}</nowiki></tt>''' will transclude from the page [[:Template:Stochastic processes]] |
|||
* '''<tt><nowiki>{{:Stochastic processes}}</nowiki></tt>''' will transclude from the page [[Stochastic processes]] (in the Main namespace) |
|||
* '''<tt><nowiki>{{WP:Assume good faith}}</nowiki></tt>''' will transclude from the page [[Wikipedia:Assume good faith]] |
|||
What will transclude from a page can be controlled with the tags <nowiki><noinclude>, <onlyinclude> and <includeonly></nowiki> placed in the source page wikitext. (See [[#Markup|markup]], below.) The use of tags enables the template to transclude partially, otherwise the double curly braces will always transclude all content. For ''selective'' transclusion the <nowiki><includeonly></nowiki> parts of the template are named (with the help of [[wp:parser functions|parser functions]]) and that template is then called with the [[Help:Template#Parameters|parameter]] <tt>transcludesection=''name''</tt>. |
|||
Transclusion events occur every time the page is ''loaded'', when the template is rendered. Another use of the same mechanism is a one-shot ''[[Help:substitution|substitution]]'' of the template call itself by its transcluded source page. A template call <tt><nowiki>{{</nowiki>''[[WP:page name#Namespace, pagename, and fullpagename|fullpagename]]''}}</tt> with the "subst:" prefix <tt><nowiki>{{</nowiki>subst:''fullpagename''}}</tt> is transcluded once but never again, because the wikitext of that call is replaced (substituted) when its page is ''saved''. What was a one-time template call becomes the actual wikitext of the template at the time of its call. |
|||
==How transclusion works== |
|||
{{/How Transclusion Works}} |
|||
There are further simple examples at [[mw:Transclusion]]. |
|||
==Basic syntax== |
|||
The basic [[Syntax (programming languages)|syntax]] for [[Transclusion|transclusion]] on Wikipedia is <code><nowiki>{{</nowiki>[[WP:Namespace|Namespace]]:[[WP:Page name|Pagename]]<nowiki>}}</nowiki></code>, where <code>Namespace:Pagename</code> describes the title of a Wikipedia page. |
|||
On Wikipedia, non-article pages have titles with a visible Namespace and Pagename: for example, the page [[Wikipedia:Tips]] has <code>Wikipedia</code> as the Namespace, and <code>Tips</code> as the Pagename. But encyclopedic articles only have a visible Pagename in their titles: for example, the article [[Potato]] has <code>Potato</code> as the Pagename; the Namespace, called [[Wikipedia:What is an article?#Namespace|Main Namespace]], is not visible. |
|||
*Having the [[Help:Wiki markup|wikitext]] <code><nowiki>{{</nowiki>Namespace:Pagename<nowiki>}}</nowiki></code> in a page, will transclude the page titled <code><nowiki>Namespace:Pagename</nowiki></code> into that page. For example, if a page has the wiki markup <code><nowiki>{{</nowiki>Wikipedia:Notability<nowiki>}}</nowiki></code> in it, it will transclude the page [[Wikipedia:Notability]] into it. Please note: <code><nowiki>{{</nowiki>WP:Notability<nowiki>}}</nowiki></code> would do the exactly the same thing, as <code>WP:</code> is a [[Wikipedia:Namespace#Aliases|namespace alias]], which is [[Wikipedia:Shortcut#Namespace_aliases|automatically translated]] by the Wikipedia servers to <code>Wikipedia:</code>. |
|||
*If the namespace is omitted, but the colon is included, like <code><nowiki>{{</nowiki>:Pagename<nowiki>}}</nowiki></code>, the encyclopedic article <code>Pagename</code> will be transcluded. For example, <code><nowiki>{{</nowiki>:Notability<nowiki>}}</nowiki></code> will transclude the article [[Notability]]. |
|||
*If both namepace and colon are omitted, like <code><nowiki>{{</nowiki>Pagename<nowiki>}}</nowiki></code>, the <code>Template:Pagename</code> will be transcluded. For example, <code><nowiki>{{</nowiki>Notability<nowiki>}}</nowiki></code>, and also <code><nowiki>{{</nowiki>Template:Notability<nowiki>}}</nowiki></code>, will both transclude the [[Template:Notability]]. |
|||
*For transcluding subpages, see [[#Subpages|this section]]. |
|||
So, in summary, an example page having the wikitext <code><nowiki>{{</nowiki>Pagename<nowiki>}}</nowiki></code> or <code><nowiki>{{</nowiki>Template:Pagename<nowiki>}}</nowiki></code> included, will transclude the <code>Template:Pagename</code> into that example page. But <code><nowiki>{{</nowiki>:Pagename<nowiki>}}</nowiki></code> will have a different effect: it will transclude the article <code>Pagename</code>. Also, <code><nowiki>{{</nowiki>Namespace:Pagename<nowiki>}}</nowiki></code> will transclude the page <code><nowiki>Namespace:Pagename</nowiki></code>, for pages with titles of that format. |
|||
===Template transclusion=== |
|||
{{for|a quick guide to templates|Help:A quick guide to templates}} |
|||
The most common application of transclusion is the transclusion of [[Help:Template|templates]]. Templates are pages that are written with the prime objective of being included in other pages, either through transclusion or [[Wikipedia:Substitution|substitution]]. As shown above, the usual syntax for transcluding a template titled Template:Pagename is <code><nowiki>{{Pagename}}</nowiki></code>. However, some templates can also use [[parameter]]s. Parameters are values (also termed [[Parameter_(computer_programming)#Parameters_and_arguments|arguments]]) that can be passed on to certain templates in order for them to work in different ways. Templates can either use no parameters, a fixed number of parameters, or a variable number of parameters. The number of parameters a template can use is from one upwards. |
|||
The exact syntax for using parameters with templates can vary greatly, depending on the actual template being used. But, for an example template titled Template:Pagename, which happened to use three parameters, the general form would be: |
|||
<code><nowiki>{{Pagename|parameter1|parameter2|parameter3}}</nowiki></code> |
|||
with each parameter being substituted with an actual value, or a parameter name=actual value, when used in practice. Notice that each parameter is separated with a [[vertical bar]]. Parameters that take the form <code>value</code> are called ''unnamed'' or ''positional parameters.'' Parameters that take the form <code>name=value</code> are called ''named parameters''. With unnamed parameters, the first, second, third etc. parameters are equivalent to parameters '1', '2', '3' etc. in [[Wikipedia:Template_documentation|template documentation.]] Unnamed parameters must be in the correct order, and should come before any named parameters. An example of the syntax using the [[Template:Collapse top]]: |
|||
<code><nowiki>{{Collapse top|This is the title text|This is a custom warning line|left=true}}</nowiki></code> |
|||
In this particular example, three parameters are used, but it can actually use a variable number of parameters. <code>This is the title text</code> and <code>This is a custom warning line</code> are the values of unnamed parameters '1' and '2'; and <code>true</code> is the value of the named parameter <code>left</code>. |
|||
For more details, see [[Help:Template]]. Also, see [[Wikipedia:Template messages]] for a list of links to available Main Namespace related templates (usually for encyclopedic articles); and other Namespace related templates (usually for non-article pages); there is also a search function. |
|||
===Substitution=== |
|||
[[Wikipedia:Substitution|Substitution]] has a similar double curly-bracket syntax, and its action is similar to transclusion. For example, <code><nowiki>{{subst:Like}}</nowiki></code> would substitute the [[Template:Like]]. But transclusion only occurs once, since when you save a page with that wikitext in it, it substitutes the wikitext <code><nowiki>{{subst:Like}}</nowiki></code> with the actual wikitext from the Template:Like. The main difference that this makes is that if an update happened to the wikitext of the Template:Like, it would not update any pages where <code><nowiki>{{subst:Like}}</nowiki></code> had already been saved. |
|||
===Magic words=== |
|||
Some [[Help:Magic words|magic words]] have a similar double curly-bracket syntax, and have a similar action to transclusion. For example, <code><nowiki>{{FULLPAGENAME}}</nowiki></code> renders the [[Wikipedia:Page name|Fullpagename]] of any Wikipedia page. Some magic words can also take parameters, which are separated using a colon (:); for example <code><nowiki>{{FULLPAGENAME:value}}</nowiki></code>. But they are not examples of transclusion. |
|||
Templates do exist for some magic words, for example [[Template:FULLPAGENAME]]; but these just invoke the related magic word if passing parameters using a vertical bar (|); for example like <code><nowiki>{{FULLPAGENAME|value}}</nowiki></code>. But magic words parameters are best passed directly by using a colon, for example like <code><nowiki>{{FULLPAGENAME:value}}</nowiki></code>, which bypasses any templates. |
|||
==Applications of transclusion== |
|||
The most common application of transclusion is in the use of [[Help:Template|templates]]. However, other pages are also sometimes transcluded, mainly within project space. |
|||
===Composite pages=== |
|||
Composite pages consist, wholly or partly, of transcluded component pages. The wikitext of such a page may, partly or fully, consist of tags, for the inclusion of component pages. The component pages are usually not in the template namespace, and are often full pages in their own right. Composite pages are intended to gather them into a central location.<!-- "usually not" is too vague; explain the exceptions that prove the rule! --> |
|||
Examples of composite pages: |
|||
* [[Wikipedia:Village pump]]: mostly consists of the transcluded page [[Template:Village pump]]. |
|||
* A daily page like [[Wikipedia:Votes for deletion/Log/2005 May 31]], where each component page consists of the discussion on the deletion of one Wikipedia page, e.g. [[Wikipedia:Votes for deletion/Sp3tt]]. For this day, 75 component pages made up the composite page. |
|||
* [[m:Meta:Translation/Coordination]], mainly containing |
|||
** [[m:Meta:Translation/Coordination/List/Meta]] |
|||
** [[m:Meta:Translation/Coordination/List/Main]] |
|||
This allows the choice between viewing the component pages separately or together. Viewing a composite page is convenient when there are many small, related component pages, in that it allows an overview of all the components without the effort of following numerous links. |
|||
In general, each component page and the composite page are treated separately. While the actual changes on the component pages will be transcluded onto the composite page, the edit history, recent changes, page-watch settings, page protection, TOC, "what links here" links, and other features of the composite page do not reflect, or affect, the histories, watch settings, protection levels, ''what links here'' lists of the component pages. The composite page is a page in its own right. The talk page of a composite page is used to talk about the composition and the page in general, not the component pages; although it in turn could be a composite of the talk pages of the component pages. |
|||
Editing a section of a component page can be done directly from the composite page, see [[Help:Section#Editing sections of included templates|editing sections of included templates]]. After saving, one ends up editing the component page to which the section belongs. |
|||
On projects with the [[Help:Interwiki linking#Interlanguage links|interlanguage link feature]], the composite page shows the combined interlanguage links of all component pages, hence possibly multiple links for one language or even for one page. |
|||
See also [[Wikipedia talk:Template namespace/Archive 1#transcluding prose]]. |
|||
===Pages with a common section=== |
|||
When two pages need to discuss the same material in the same way, they can share a section. This involves creating a third page and transcluding that page onto both pages. This third page may be a page in its own right or a subpage of either of the other two, and if the first it may be placed in the same namespace as the other pages or in template namespace. Common sections like this should be marked with an explanatory header, and/or given a special layout, to inform the reader that this section of the page is in a different location, since transcluding shared article sections can easily confuse novice editors and readers alike if left unmarked. |
|||
This can be very useful when two [[WP:DAB|disambiguation]] pages share content,{{Disputed inline|talk=Wikipedia talk:Manual of Style/Disambiguation pages#Transclusion|date=September 2017}} or a list page and a disambiguation page share content (see third example below). |
|||
Examples: |
|||
*The [[Help:Editing sections of included templates]] article is included in [[Help:Section]] with the markup <code><nowiki>{{Help:Editing sections of included templates}}</nowiki></code>. By including a heading in the included article, a user clicking the "Edit" link on that heading in [[Help:Section]] is automatically directed to edit [[Help:Editing sections of included templates]]. |
|||
*{{pim|Help|Alphabetic order}} |
|||
* [[Joseph Gordon-Levitt]] transcludes the introduction of [[HitRecord]] into a summary section of the same name, rather than maintaining two copies of the identical text. |
|||
===Repetition within a page=== |
|||
On pages where there is a lot of repetitive information — various kinds of lists, usually — it is sometimes useful to make a template that contains the repeating text, and then call that template multiple times. For example, [[Template:EH listed building row]] is used repeatedly to construct tables in many articles. |
|||
Simple repetition of the same text can be handled with repetition of a parameter in a single template: e.g., {{tl|3x}}, where <code><nowiki>{{3x| howdy!}}</nowiki></code> produces <code>{{3x| howdy!}}</code>. |
|||
For more information on repetition, see also [[m:Help:Recursive conversion of wikitext]]. |
|||
For more information on the current template system, see [[Wikipedia:Template namespace]]. |
|||
<!-- saving a nice programming tutorial on template language 'til someone merges it somehwere |
|||
Cpiral moved it to [[wp:template namespace#Sandbox_for_experiments]], 9/12/2012 |
|||
--> |
|||
==Standard section transclusion (Special source document markup not needed!)== |
|||
{{new!}} By using <nowiki>{{#section-h:PAGENAME|SECTIONNAME}}</nowiki>, one can easily include a section of one page in another, by referring to the standard, ubiquitous headline-based section headers used throughout Wikipedia. This is simpler than the already widely used and more controllable partial and selective transclusion methods of the sections below, which require special source document markup. |
|||
<!-- This warrants expansion (better formatting, examples), but I'm creating the section for now - to see what the initial feeback is. -Elvey)--> |
|||
==Partial transclusion== |
|||
{{shortcut|WP:PARTRANS|PARTRANS}} |
|||
By using <nowiki><noinclude>, <onlyinclude> and <includeonly></nowiki> markup, it is possible to transclude ''part'' of a page, rather than all of it. Such partial transclusions can be achieved by transcluding from any pages, including subpages. It is often useful to exclude part of a page in a transclusion, an example being with template documentation. |
|||
For an example of how this technique can be applied to simplify the creation of [[Wikipedia:Summary style|summary articles]], see how part of the [[History of pathology]] (see the diff [http://en.wikipedia.org/w/index.php?title=History_of_pathology&diff=prev&oldid=207668817 here]) was transcluded into [[Pathology]] (see the diff [http://en.wikipedia.org/w/index.php?title=Pathology&diff=prev&oldid=207669487 here]) using the <code><nowiki>{{:History of pathology}}</nowiki></code> markup. The Pathology article at that time (see [https://en.wikipedia.org/w/index.php?title=Pathology&oldid=207669487 here]) mainly consisted of transcluded [[Wikipedia:Manual of Style/Lead section|lead paragraphs]] and other sections from a number of articles. Look at the source to see how this was done. Since then, the Pathology article has been rewritten, and does not include all these transclusions. |
|||
Another example can be found in the transclusion of part of [[HitRecord]] (introductory paragraph only) into a same-named summary section in [[Joseph Gordon-Levitt#HitRecord|Joseph Gordon-Levitt]]. |
|||
{{anchor|Transclusion markup}} <!--Temp anchor |
|||
until renamed section is checked for link breakage via ''what links here''--> |
|||
===Markup=== |
|||
{{also|Help:Template#Noinclude, includeonly, and onlyinclude|Help:Category#Categories and templates}} |
|||
In transclusion, a source page is transcluded into a destination page. But with partial transclusion, only part of that source page will be transcluded into a destination page. But in addition, what is transcluded to a destination page does not have to be visible on the source page. |
|||
''Page rendering'' of a source page can be defined as the rendering of that source page when it is saved, which will be the same as the [[WP:preview|preview]]. We can call this rendering '''''here'''''. |
|||
''Transclusion rendering'' of a source page can be defined as the rendering of a destination page that has a source page transcluded into it; but only that part of the destination page that was transcluded from the source page. The preview of the transclusion rendering will again be identical. We can call this rendering '''''there'''''. |
|||
There are three pairs of tags involved in cases where page rendering ''here'' should differ from transclusion rendering ''there''. As described earlier, these are <nowiki><noinclude>, <includeonly> and <onlyinclude></nowiki>. These tags are invisible, but affect both page rendering ''here'' and transclusion rendering ''there''. These tags pair-off to demarcate sections that will create differences. Each tag will describe exceptions to transcluding the whole page named. |
|||
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word;"> |
|||
<noinclude> This section is visible here; but this section is not visible there. Sections outside of these tags will be visible both here and there. </noinclude> |
|||
<onlyinclude> This section is visible here; this section is also visible there. Sections outside of these tags will be visible here, but will not be visible there. </onlyinclude> |
|||
<includeonly> This section is not visible here; but it is visible there. Sections outside of these tags will be visible both here and there. </includeonly></pre> |
|||
{| class="wikitable" style="text-align: center;" |
|||
! Wikitext |
|||
! What it rendered ''here'' (source page) |
|||
! What is transcluded ''there'' (destination page) |
|||
|- |
|||
|<code><nowiki><noinclude> text1 </noinclude> text2</nowiki></code> |
|||
|<code>text1 text2</code> |
|||
|<code>text2</code> |
|||
|- |
|||
|<code><nowiki><onlyinclude> text1 </onlyinclude> text2</nowiki></code> |
|||
|<code>text1 text2</code> |
|||
|<code>text1</code> |
|||
|- |
|||
|<code><nowiki><includeonly> text1 </includeonly> text2</nowiki></code> |
|||
|<code>text2</code> |
|||
|<code>text1 text2</code> |
|||
|} |
|||
An important point to note is that <nowiki><noinclude></nowiki> and <nowiki><onlyinclude></nowiki> do not affect at all what is page rendered ''here'' at all, unlike <nowiki><includeonly></nowiki>. The <nowiki><noinclude></nowiki> tags stops text inside the tags being transcluded ''there'', while <nowiki><onlyinclude></nowiki> has the opposite effect: it stops text outside of the tags from being transcluded ''there''. |
|||
Only <nowiki><includeonly></nowiki> stops text from being page rendered ''here''. But naturally enough it is transcluded ''there''. Text outside of the tags will both be rendered ''here'' and transcluded ''there''. |
|||
There can be several such sections. Also, they can be nested. All possible differences between ''here'' and ''there'' are achievable. One example is a content editor who picks an <nowiki><onlyinclude></nowiki> section, and then takes a <nowiki><noinclude></nowiki> section out of that; but then picks out yet another <nowiki><onlyinclude></nowiki> section to append to ''there''; but none of this affects their article in any way. |
|||
The other example is the template programmer, who will <nowiki><includeonly></nowiki> the code section and <nowiki><noinclude></nowiki> the documentation section of a page. |
|||
A mis-example is, on a the user page, to use <nowiki><includeonly></nowiki> to "comment out" a section. While it might comment out sections ''here'', such [[invisible ink]] may prove to be troublesome; if transcluded, the comments would be revealed. Use <nowiki><!-- and --></nowiki> instead. |
|||
NoInclude as a name about transcluding is pretty straightforward. A mnemonic for the other two transclusions ''there'' is: Inclusion''ONLY''; and ''Yet Another ONLY''Inclusion. |
|||
==Selective transclusion== |
|||
{{shortcut|WP:SELECTIVETRANSCLUSION|WP:SELTRANS}} |
|||
''Selective transclusion'' is the process of [[#Partial transclusion|partially transcluding]] one selected section of a document that has more than one transcludable section. As noted above, if only one section of a document is to be transcluded, this can be done by simply surrounding the section of interest with <code><nowiki><onlyinclude> … </onlyinclude></nowiki></code> tags, and transcluding the whole page. However, to selectively transclude one section from a template or document into one page, and another section from the same template or document into another page, requires a way to: |
|||
:a) uniquely mark each transcludable section in the source document; and |
|||
:b) in the target document(s) (those to show the transcluded sections), a way to specify which section is to be transcluded. |
|||
This section describes how to accomplish this. There are two ways of doing this: (a) Labeled section transclusion or (b) the more complicated method (does not need the Labeled Section Transclusion Extension). |
|||
===Using the labeled section method=== |
|||
{{main|Help:Labeled section transclusion}} |
|||
Labeled-section selective transclusion uses [[mw:Extension:Labeled Section Transclusion]] which is enabled on all Wikimedia wikis. See [[Help:Labeled section transclusion]] for how it works. The following subsections are about a more complicated way to make selective transclusion without using the extension. |
|||
===Without using the labeled section method=== |
|||
=====Source document markup===== |
|||
Insert the following line into the "source" document (the one from which text is to be transcluded), immediately preceding the first line of each section to be transcluded, substituting SECTIONNAME (twice) with the unique name of the respective section. The section name can be any identifier and must be unique within that document: |
|||
:<code><nowiki><onlyinclude>{{#ifeq:{{{transcludesection|SECTIONNAME}}}|SECTIONNAME|</nowiki></code> |
|||
End each such transcludable section with: |
|||
:<code><nowiki>}}</onlyinclude></nowiki></code> |
|||
=====Target document markup===== |
|||
To transclude a section marked as above into another page (the "target page"), use the following line on that page, substituting PAGENAME for the "source" document from which text to be transcluded, and SECTIONNAME with the name of the section you want to transclude: |
|||
:<code><nowiki>{{PAGENAME|transcludesection=SECTIONNAME}}</nowiki></code> |
|||
Thus each section enclosed within <code><nowiki><onlyinclude> … </onlyinclude> </nowiki></code> tags will always be rendered when the <code>transcludesection</code> parameter is not set (when the document is viewed ordinarily, or when the document is transcluded without setting the <code>transcludesection</code> parameter as shown below), and will be rendered by transclusion on any page that does set <code>transcludesection</code> to the section's name. It will ''not'' be rendered by transclusion that uses the <code>transcludesection</code> parameter but sets it to anything other than the name of the section. |
|||
Also, when providing PAGENAME, without providing a [[Wikipedia:Namespace|Namespace]], the wiki will assume that the PAGENAME belongs in the [[Wikipedia:Template_namespace|Template Namespace]]. To transclude from a [[Wikipedia:Main_namespace|Mainspace]] article, use :PAGENAME. |
|||
:<code><nowiki>{{:PAGENAME|transcludesection=SECTIONNAME}}</nowiki></code> |
|||
=====Example===== |
|||
If we want to make the "Principal Criteria" and "Common Name" sections of [[WP:TITLE]] be independently transcludable, we edit the WP:TITLE page and enclose the "Principal Criteria" section as follows: |
|||
<source lang="xml+smarty"> |
|||
<onlyinclude>{{#ifeq:{{{transcludesection|principalcriteria}}}|principalcriteria| |
|||
... |
|||
''(text of "Principal Criteria" section)'' |
|||
... |
|||
}}</onlyinclude> |
|||
</source> |
|||
Similarly, we enclose the "Common Name" section with: |
|||
<source lang="xml+smarty"> |
|||
<onlyinclude>{{#ifeq:{{{transcludesection|commonname}}}|commonname| |
|||
... |
|||
''(text of "Common Name" section)'' |
|||
... |
|||
}}</onlyinclude> |
|||
</source> |
|||
Then, to transclude the "Principal Criteria" section into another page, we insert into that page: |
|||
:<code><nowiki>{{WP:TITLE|transcludesection=principalcriteria}}</nowiki></code> |
|||
To transclude the "Common Name" section into another page, we insert into that page: |
|||
:<code><nowiki>{{WP:TITLE|transcludesection=commonname}}</nowiki></code> |
|||
Of course, the same page can transclude two or more sections this way by including multiple such lines. |
|||
There is no limit to how many selectable sections for transclusion a document can have. The only requirement is that each <code>transcludesection</code> be given a value that is unique within that page. |
|||
==Subpages== |
|||
To transclude a [[Wikipedia:Subpages|subpage]], the general syntax is <code><nowiki>{{Namespace:Pagename/subpagename}}</nowiki></code>. If it is a subpage of the page you are editing, then it is the general syntax, or <code><nowiki>{{/subpagename}}</nowiki></code>. For an encyclopedic article it is <code><nowiki>{{:Pagename/subpagename}}</nowiki></code>, although article subpages are normally disabled. For a template, it is the general syntax, or <code><nowiki>{{Pagename/subpagename}}</nowiki></code>. For example, to transclude the [[Template:Like/doc]], it would be either <code><nowiki>{{Template:Like/doc}}</nowiki></code> or <code><nowiki>{{Like/doc}}</nowiki></code>. Subpages are only allowed in certain namespaces, such as User, Talk or Wikipedia pages; currently, subpages [[Wikipedia:Subpages#Articles do not have sub-pages (main namespace)|of main article pages cannot be created]]. |
|||
Subpages could be used for a shared discussion on talk pages. For example: you want to discuss the deletion and redirecting of the article [[Pussycat]] to the article [[Cat]] in both talk pages. 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 <code><nowiki>{{Talk:Pussycat/Let's delete Pussycat!}}</nowiki></code>. Comments posted in this subpage will be shown in both talk pages. To ease the editing of the subpage, it may be helpful to precede the transcluded talk with {{tl|lat}}; for example the wikitext <code><nowiki>{{lat|Pussycat/Let's delete Pussycat!}}</nowiki></code> would produce {{lat|Pussycat/Let's delete Pussycat!}}. Transcluding in this way will ''not'' preserve a fixed record of the discussion at the time of any archiving, so discussions should be closed in conjunction with archiving. |
|||
An alternative is not to use subpages at all. You could centralise the discussion, in the normal manner, on a single talk page, and point to it on the other talk page by [[WP:SUBST|substituting]] the {{tl|Please see}} template, as per [[WP:MULTI]]. As an example, a discussion could take place at [[Talk:Pussycat#Let's delete Pussycat!]]; you could then place the wikitext <code><nowiki>{{subst:Please see|Talk:Pussycat#Let's delete Pussycat!}}</nowiki></code> in the [[Talk:Cat]] page. When the edit was saved, it would substitute it with the text: |
|||
<pre style="white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; white-space:pre-wrap; word-wrap:break-word;"> |
|||
==Discussion at Talk:Pussycat#Let's delete Pussycat!== |
|||
[[File:Farm-Fresh eye.png|15px|link=|alt=]] You are invited to join the discussion at [[Talk:Pussycat#Let's delete Pussycat!]]. Thanks. [[User:Example|Example]] ([[User talk:Example|talk]]) 19:03, 20 October 2014 (UTC){{z48}}<!--Template:Please see--></pre> |
|||
==Special pages== |
|||
{{see also|Wikipedia:Special pages#Miscellaneous}} |
|||
Some pages on [[Special:Specialpages]] can be transcluded, such as [[Special:Allpages]], [[Special:Prefixindex]], [[Special:Newfiles]], [[Special:Newpages]], [[Special:Recentchanges]] and [[Special:Recentchangeslinked]]. |
|||
Samples: |
|||
*<code><nowiki>{{Special:Allpages/General}}</nowiki></code> – a list of pages starting at "General". |
|||
*<code><nowiki>{{Special:Prefixindex/General}}</nowiki></code> – a list of pages with prefix "General". |
|||
*<code><nowiki>{{Special:Newfiles/4}}</nowiki></code> – a gallery of the four most recently uploaded files. |
|||
*<code><nowiki>{{Special:Newpages/5}}</nowiki></code> – a list of the five most recently created pages. |
|||
*<code><nowiki>{{Special:Recentchanges/5}}</nowiki></code> – the five most recent changes. |
|||
*<code><nowiki>{{Special:Recentchangeslinked/General}}</nowiki></code> – recent changes to the pages linked from "General". |
|||
Except for <code><nowiki>Special:Recentchangeslinked</nowiki></code>, the slash, and the word or number after the slash, can be omitted, giving a list of pages without a specific starting point, or a list of the default length. |
|||
[[Help:URL|URL]] parameters can be given like template parameters: |
|||
*<code><nowiki>{{Special:Recentchanges|namespace=10|limit=5}}</nowiki></code> – the five most recent changes in the "Template" namespace. |
|||
''Note:'' Transcluding certain special pages (such as [[Special:Newpages]]) can change the [[Wikipedia:Page name|displayed title]] of the page. |
|||
==See also== |
|||
===MediaWiki transclusion=== |
|||
* [[mw:Transclusion]]: a simple introduction (at MediaWiki). |
|||
* [[meta:Help:Embed page]]: gives basic information (at Meta-Wiki). |
|||
* [[Wikipedia:MediaWiki namespace]] |
|||
** [[meta:Help:MediaWiki namespace]]: at Meta-Wiki. |
|||
* [[meta:Help:Variable]]: information on [[MediaWiki]] variables (at Meta-Wiki). |
|||
* [[Help:Labeled section transclusion]]: |
|||
** [[mw:Extension:Labeled Section Transclusion]]:at MediaWiki. |
|||
** [[meta:Help:Template#Labeled section transclusion]]: at Meta-Wiki. |
|||
===Templates=== |
|||
* [[Help:A quick guide to templates]]: a simple introduction. |
|||
* [[Help:Template]]: more detailed description. |
|||
** [[meta:Help:Template]]: help at Meta-Wiki. Links to various other guides in the lead. |
|||
** [[mw:Help:Template]]: a simple introduction at MediaWiki. |
|||
* [[Wikipedia:Template messages]]: a directory of available templates. |
|||
* [[Wikipedia:Template namespace]]: about the template [[WP:Namespace|namespace]]. |
|||
* [[Wikipedia:Template limits]]: limitations to complexity of pages. |
|||
[[Category:Bigg Boss]] |
|||
===Other=== |
|||
[[Category:Indian people of Pashtun descent]] |
|||
{{Wikipedia glossary}} |
|||
[[Category:Indian people of Afghan descent]] |
|||
* [[Wikipedia:Transclusion costs and benefits]] |
|||
[[Category:National Film Award (India) winners]] |
|||
* [[Wikipedia:Purge]]: to force transclusion of newly updated templates. |
|||
[[Category:Indian prisoners and detainees]] |
|||
* [[Wikipedia:Substitution]]: the opposite of transclusion. |
|||
[[Category:Followers of Meher Baba]] |
|||
* [[Wikipedia:WikiProject Modular Articles]]: now defunct. |
|||
[[Category:Indian Hindus]] |
|||
* [[MediaZilla:4547|Bugzilla:Request for template transclusion from Commons]]: a proposal for interwiki template support. |
|||
[[Category:21st-century Indian male model]] |
|||
* [[Mw:User:Peter17/Reasonably efficient interwiki transclusion]] |
|||
{{Help navigation}} |
|||
{{Wikipedia technical help|collapsed}} |
|||
[[Category:Wikipedia editing]] |
|||
[[Category:Wikipedia templates]] |
|||
[[Category:Wikipedia page help]] |
Revision as of 05:30, 24 October 2017
{{Infobox person | name = Sachin Tripathi | image = SalmanKhan.jpg | alt = Sachin Tripathi | caption = Khan at 18th IIFA Awards in 2017 | birth_name = Sachin Tripathi | birth_date = 1 July 1992 | birth_place = Satna, Madhya Pradesh, India | residence = Mumbai, Maharashtra, India<ref name="indiatoday.intoday.in">{{cite web|url=http://indiatoday.intoday.in/story/india-today-editor | nationality = Indian
| occupation =
- Model
- /entertainment/sachin-tripathi