User:Chela5808/Transclusion and Substitution
Welcome to my Testing Laboratory | |||||
---|---|---|---|---|---|
My Sandbox | Various Templates | Pedagogical Templates | Flash Simulations | Tables | |
Math Projects | Audio and Video | Special Characters & LaTeX | HTML and CSS | Transclusion & Substitution | |
File extensions | Be aware | Miscellaneous | L4C | My Sandbox 2 | |
Images | Quizzes |
Contents
Understanding transclusion
See Wikipedia Article: Transclusion
Template syntax
1. If the source is in the Main article namespace (e.g., "Cat"), you must put a colon (:) in front of the name, thus: '''{{:Cat}}'''
2. If the source is in the Template namespace (e.g., "Template:Villagepumppages"), just use the name itself, alone, thus: '''{{Villagepumppages}}'''
3. If the source is in any other namespace (e.g., "User:Example"), you must use the full name, including the namespace, thus: '''{{User:Example}}'''
To transclude any source page (within a single MediaWiki project, such as en:Wikipedia) within another target page, include the following code:
{{SOMEPAGE}}
Whenever the target page A with this code is rendered, the engine will include in that place not the code itself, but the entire content of the source page B, SOMEPAGE.
Partial transclusion
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.
For an example of how this technique can be applied to simplify the creation of summary articles, see Pathology, which consists of a collection of transcluded lead paragraphs from several main articles.
Transclusion markup
- noinclude. The markup <noinclude>...</noinclude> means that the text between the tags will not be transcluded onto another page, but will only appear on the page itself. This is useful for documentation.
- includeonly. The markup <includeonly>...</includeonly> means that the text between the tags will only be used when the page is transcluded onto another page, and will not appear on the page itself. This can be useful, for example, for adding categories to pages transcluding a template, without adding the template itself to these categories.
- onlyinclude. The markup <onlyinclude>...</onlyinclude> indicates that only text surrounded by "onlyinclude" markup should be transcluded onto another page. This is the most subtle of the partial transclusion tags because it often overrules the others. If there is at least one pair of "onlyinclude" tags on a page, then whenever this page is transcluded, it is only the material within the "onlyinclude" tags which gets transcluded. There can be several such sections, and within each such section, some material might be further excluded by "noinclude" tags, and might also be surrounded by "includeonly" tags so that it does not appear on the original page itself. But material outside the "onlyinclude" tags will be ignored when the page is transcluded onto another page. This can be useful, for example, to repeat a small part of one page on a second one: just surround the small part by onlyinclude tags, and transclude it onto the second page.
Testing Case 1 Transclusion from project pages
This is test for a partial transclusion of two pages:
MathGloss/L/Logarithm_(Base_a) and
Math_Tables_and_Formulas/Trigonometry/Properties_and_Formulas_of_Logarithms
How? It's quite easy!!
Let's add content from two source pages to this page:
STEP 1. On source pages:
MathGloss/L/Logarithm_(Base_a)
and
Math_Tables_and_Formulas/Trigonometry/Properties_and_Formulas_of_Logarithms
- Switch to edit mode,
- Add codes '''<onlyinclude>...</onlyinclude>''' surrounding text you want to be transcluded,
- Save page.
STEP 2. On target page (this page):
- Insert codes:
{{:MathGloss/L/Logarithm_(Base_a)}}
<br/>
{{:Math_Tables_and_Formulas/Trigonometry/Properties_and_Formulas_of_Logarithms}}
in section where source page you want to be displayed.
I decided to enclose my partialy transcluded pages into a red bordered HTML "Div" box so transcluted text can be better identified, the result is:
Logarithm (Base a)
The logarithm of [math]x\,[/math] to the base [math]a\,[/math], denoted by [math]log_{a}x\,[/math], is that real number [math]u\,[/math] such that [math]a^u=x\,[/math] , where [math]x\gt0\,[/math] and [math]a\,[/math] is a positive constant other than [math]1\,[/math].
|
Examples
- [math]10\,000=10^4\,[/math]. The exponent to which we raise [math]10\,[/math] to get [math]10\,000\,[/math] is [math]4\,[/math], so [math]\log_{10}10\,000=4\,[/math]
- [math]8=2^3\,[/math]. The exponent to which we raise [math]2\,[/math] to get [math]8\,[/math] is [math]3\,[/math], so [math]\log_{2}8=3\,[/math]
- [math]1=6^0\,[/math]. The exponent to which we raise [math]6\,[/math] to get [math]1\,[/math] is [math]0\,[/math], so [math]\log_{6}1=0.\,[/math]
- [math]3=\sqrt{9}=9^{\tfrac {1}{2}}[/math]. The exponent to which we raise [math]9\,[/math] to get [math]3\,[/math] is [math]\tfrac {1}{2}\,[/math], so [math]\log_{9}3=\tfrac {1}{2}\,[/math]
- [math]8=8^1\,[/math]. The exponent to which we raise [math]8\,[/math] to get [math]8\,[/math] is [math]1\,[/math], so [math]\log_{8}8=1\,[/math]
Properties and Formulas | Comments and Examples |
---|---|
[math]f(x)=a^x,\quad a\gt0\text{ and }a\neq1[/math] | [math]\text{Exponential Function}\,[/math] |
[math]f(x)=log_{a}x,\quad a\gt0\text{ and }a\neq1[/math] | [math]\text{Logarithmic Function}\,[/math] |
[math]\log_{b}m=\frac{\log_{a}m}{\log_{a}b}[/math] | [math]\text{The Change-of-Base-Formula}\,[/math] |
[math]\log_{a}x=y \longleftrightarrow x=a^y\,[/math] | [math]\text{A Logarithm is an Exponent}\,[/math] |
[math]\log_{a}1=0\,[/math] | [math]\text{Property}\,[/math] |
[math]\log_{a}a=1\,[/math] | [math]\text{Property}\,[/math] |
[math]\log_{a}a^x=x\,[/math] | [math]\text{Property}\,[/math] |
[math]a^{\log_{a}x}=x[/math] | [math]\text{Property}\,[/math] |
[math]\log_{a} mn=\log_{a}m+\log_{a}n\,[/math] | [math]\text{The Product Rule}\,[/math] |
[math]\log_{a} \frac {m}{n}=\log_{a}m-\log_{a}n\,[/math] | [math]\text{The Quotient Rule}\,[/math] |
[math]\log_{a}m^p=p\log_{a}m\,[/math] | [math]\text{The Power Rule}\,[/math] |
[math]\log_{a}m^\frac{1}{r}=\frac{1}{r}\log_{a}m\,[/math] | [math]\text{The Root Rule}\,[/math] |
[math]\log_{a}m=\log_{a}n\longleftrightarrow m=n,\text{ for }a\gt0\text{ and }a\neq1\,[/math] | [math]\text{Property of Logarithmic Equality}\,[/math] |
My comments about transclusion
- We can make Complete transclusions or Partial transclusions of a page.
- Tranclusion saves time. It's a helpful aid for efficiently reusing of resources.
- Preparing a page for transclusion, implies editing pages maybe pertaining to other projects. So collaboration between editors of different projects is mandatory.
- Title "Examples" which comes from one source page is included in the TOC of target page.
- Some style attributes (content transcluded from source page) are modified by target page.
- What if I have two or more sections in one source page surrounded by <onlyinclude>...</onlyinclude>, but I only want to transclude one of that sections to my target page?