Simple Templates: Difference between revisions
Created page with "<h2>Simple Templates</h2> <p>I view simple templates as those which do not use variables.</p> <p>For the mh370wiki.net site I have a lot of useful components in the Template namespace. When these are transcluded into a page there is no need to include the namespace.</p> <h3>A Short Line</h3> <p>I frequently use a short line to separate parts of a page. The html horizontal line <hr> is full width by default and has no significant white space before or after.</p> <p>My S..." |
No edit summary |
||
| Line 15: | Line 15: | ||
<p>And the result is this:-</p> | <p>And the result is this:-</p> | ||
{{ShortLine}} | {{ShortLine}} | ||
<h3>A Signature</h3> | |||
<p>To 'sign' an article with my name I just write:-</p> | |||
<pre>{{Signature}}</pre> | |||
<p>The template is simple:-</p> | |||
<pre><p style="width:90%; margin-left: auto; margin-right: auto; font-size:1em; text-align:right;"><u>Grant</u></p></pre> | |||
<p>The result is at the end of this page.</p> | |||
{{Signature}} | |||
Revision as of 10:28, 15 July 2025
Simple Templates
I view simple templates as those which do not use variables.
For the mh370wiki.net site I have a lot of useful components in the Template namespace. When these are transcluded into a page there is no need to include the namespace.
A Short Line
I frequently use a short line to separate parts of a page. The html horizontal line
is full width by default and has no significant white space before or after.
My ShortLine is simple and reusable:-
<includeonly><div style="margin-left:20%; margin-right:20%; margin-top:1em; margin-bottom:1em;"><hr></div></includeonly>
If there was nothing else on the source page then the includeonly tags would not be needed. But I have kept a few previous versions, where I adjusted the white space, between noinclude tags.
To use the ShortLine I just transclude it with this instruction:-
{{ShortLine}}
And the result is this:-
A Signature
To 'sign' an article with my name I just write:-
{{Signature}}
The template is simple:-
<p style="width:90%; margin-left: auto; margin-right: auto; font-size:1em; text-align:right;"><u>Grant</u></p>
The result is at the end of this page.
Grant