উইকিপিডিয়া:প্রতিলিপি অন্তর্ভুক্তি: সংশোধিত সংস্করণের মধ্যে পার্থক্য

বিষয়বস্তু বিয়োগ হয়েছে বিষয়বস্তু যোগ হয়েছে
Jayantanth (আলোচনা | অবদান)
পরিষ্কারকরণ
৩ নং লাইন:
'''[[Transclusion]]''' means the inclusion of the content of one document in another document by reference. In Wikipedia, 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 [[WP:wikitext|wikitext]] of the target page. Changes made to a page are automatically reflected on all pages into which that page has been transcluded. A page that is intended to be transcluded into other pages is called a [[Help:Template|template]].
 
The basic syntax used to produce transclusion in wikitext is '''''<tt><nowiki>{{Namespace:Name}}</nowiki></tt>''''', which will be replaced by the content of the page named ''Namespace:Name'' when it is rendered on the user's display. If the referenced page name does not begin with a namespace identifier (''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]] - specifically: {{Like}}
* '''<tt><nowiki>{{Stochastic processes}}</nowiki></tt>''' will transclude from the page [[:Template:Stochastic processes]]
* '''<tt><nowiki>{{:Calculus}}</nowiki></tt>''' will transclude from the page [[Calculus]] (in the Main namespace)
* '''<tt><nowiki>{{WP:Assume good faith}}</nowiki></tt>''' will transclude from the page [[Wikipedia:Assume good faith]]
 
It is also possible to pass parameters to a template, using the expanded syntax described at [[Help:Template]], which can affect what text in the template is rendered. For example, to highlight text like {{highlight|this}}, the text-to-be-highlighted is passed as a parameter to the ''highlight'' template: <code><nowiki>{{highlight|this}}</nowiki></code>.
৮২ নং লাইন:
===Selective transclusion===
{{shortcut|WP:SELECTIVETRANSCLUSION|WP:SELTRANS}}
<b>Selective transclusion</b> 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 '''<tt><nowiki><onlyinclude> … </onlyinclude></nowiki></tt>''' tags, and transcluding the whole page. However, to transclude one section from a template or document into one page, and another section from the same template or document into another page, that's selective transclusion, which 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.
৯০ নং লাইন:
====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:
:<tt><nowiki><onlyinclude>{{#ifeq:{{{transcludesection|SECTIONNAME}}}|SECTIONNAME|</nowiki></tt>
End each such transcludable section with:
:<tt><nowiki>}}</onlyinclude></nowiki></tt>
 
====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:
:<tt><nowiki>{{PAGENAME|transcludesection=SECTIONNAME}}</nowiki></tt>
 
Thus each section is enclosed within '''<tt><nowiki><onlyinclude> … </onlyinclude> </nowiki></tt>''' tags will always be rendered when the '''<tt>transcludesection</tt>''' parameter is not set (when the document is viewed ordinarily, or when the document is transcluded without setting the '''<tt>transcludesection</tt>''' parameter as shown below), and will be rendered by transclusion on any page that does set '''<tt>transcludesection</tt>''' to the section's name. It will ''not'' be rendered by transclusion that uses the '''<tt>transcludesection</tt>''' 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.
 
:<tt><nowiki>{{:PAGENAME|transcludesection=SECTIONNAME}}</nowiki></tt>
 
====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:
:<tt><nowiki><onlyinclude>{{#ifeq:{{{transcludesection|principalcriteria}}}|principalcriteria|</nowiki></tt>
:...
:''(text of "Principal Criteria" section)''
:...
:<tt><nowiki>}}</onlyinclude></nowiki></tt>
 
Similarly, we enclose the "Common Name" section with:
:<tt><nowiki><onlyinclude>{{#ifeq:{{{transcludesection|commonname}}}|commonname|</nowiki></tt>
:...
:''(text of "Common Name" section)''
:...
:<tt><nowiki>}}</onlyinclude></nowiki></tt>
 
Then, to transclude the "Principal Criteria" section into another page, we insert into that page:
:<tt><nowiki>{{WP:TITLE|transcludesection=principalcriteria}}</nowiki></tt>
 
To transclude the "Common Name" section into another page, we insert into that page:
:<tt><nowiki>{{WP:TITLE|transcludesection=commonname}}</nowiki></tt>
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 '''<tt>transcludesection</tt>''' be given a value that is unique within that page.
 
===Subpages===