Template:Main: Difference between revisions

From LifeWiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<includeonly>:{{#If:{{{1|}}}|''Main article: [[{{{1}}}|{{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}]]''|You must specify an article title when using <nowiki>{{Template:main}}</nowiki>.}}</includeonly>
<includeonly>:{{#If:{{{1|}}}|''Main article: [[{{{1}}}|{{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}]]''|You must specify an article title when using <nowiki>{{Template:main}}</nowiki>.}}</includeonly><noinclude>This is a small template to link to a main article from a small sub-article on a different page.
<noinclude>This is a small template to link to a main article from a small sub-article on a different page.
It takes as parameters the name of the main article and an optional alternative name (if no alternative name is given then the link text is the title of the main article).  If no parameters or blank parameters are given then the template gives an error.
It takes as parameters the name of the main article and an optional alternative name (if no alternative name is given then the link text is the title of the main article).  If no parameters or blank parameters are given then the template gives an error.


Line 13: Line 12:
<nowiki>{{main}}</nowiki> yields:
<nowiki>{{main}}</nowiki> yields:
{{main}}
{{main}}
[[Category:Internal link templates]]
[[Category:Hatnote templates]]
</noinclude>
</noinclude>

Latest revision as of 18:35, 29 December 2020

This is a small template to link to a main article from a small sub-article on a different page. It takes as parameters the name of the main article and an optional alternative name (if no alternative name is given then the link text is the title of the main article). If no parameters or blank parameters are given then the template gives an error.

examples:

{{main|Spaceship}} yields:

Main article: Spaceship

{{main|Spaceship|Spaceship page}} yields:

Main article: Spaceship page

{{main}} yields:

You must specify an article title when using {{Template:main}}.