Template:shortcut
From Homestar Runner Wiki
(Difference between revisions)
												
			
		| It's dot com  (Talk | contribs)  (switch cat) |  (adding more desc; how's that?) | ||
| Line 2: | Line 2: | ||
| Shortcut:<br>[[HRW:{{{1}}}]]{{#if:{{{2|}}}|<br>[[HRW:{{{2}}}]]|}}{{#if:{{{3|}}}|<br>{{{3}}}|}}</div><noinclude> | Shortcut:<br>[[HRW:{{{1}}}]]{{#if:{{{2|}}}|<br>[[HRW:{{{2}}}]]|}}{{#if:{{{3|}}}|<br>{{{3}}}|}}</div><noinclude> | ||
| ===Usage:=== | ===Usage:=== | ||
| - | *<code><nowiki>{{shortcut|SHORTCUT1}}</nowiki></code> — automatically links to '''HRW:SHORTCUT1''' | + | When linking to a shortcut in the '''HRW''' Pseudo-namespace, simply enter the target name (without the namespace) as a template parameter: | 
| + | *<code><nowiki>{{shortcut|SHORTCUT1}}</nowiki></code> — automatically links to '''HRW:SHORTCUT1''' (''Note that the '''HRW:''' pseudo-namespace is automatically added'') | ||
| *:or | *:or | ||
| *<code><nowiki>{{shortcut|SHORTCUT1|SHORTCUT2}}</nowiki></code> — automatically links to '''HRW:SHORTCUT1''' and '''HRW:SHORTCUT2''' | *<code><nowiki>{{shortcut|SHORTCUT1|SHORTCUT2}}</nowiki></code> — automatically links to '''HRW:SHORTCUT1''' and '''HRW:SHORTCUT2''' | ||
| *:or | *:or | ||
| - | *<code><nowiki>{{shortcut|SHORTCUT1|SHORTCUT2|[[HRW:SHORTCUT3]]}}</nowiki></code> — same as above, except the third parameter requires extra formatting since it's a free-for-all. As shown, it links to HRW:SHORTCUT3, but you could string any number of extra links in the form: <code><nowiki>[[HRW:SHORTCUT3]]<br>[[HRW:SHORTCUT4]]</nowiki></code>. | + | *<code><nowiki>{{shortcut|SHORTCUT1|SHORTCUT2|[[HRW:SHORTCUT3]]}}</nowiki></code> — same as above, except the third parameter requires extra formatting since it's a free-for-all. As shown, it links to '''HRW:SHORTCUT3''', but you could string any number of extra links in the form:   | 
| + | **<code><nowiki>[[HRW:SHORTCUT3]]<br>[[HRW:SHORTCUT4]]</nowiki></code> — adds links to '''HRW:SHORTCUT3''' and '''HRW:SHORTCUT4''' | ||
| + | **<code><nowiki>[[SHORTCUT3]]<br>[[HRWiki:SHORTCUT4]]</nowiki></code> — adds links to '''SHORTCUT3''' and '''HRWiki:SHORTCUT4''' | ||
| + | This last parameter is used when you need to link to '''non-HRW''' pages or the page containst more than two shortcuts.  You may link to an '''HRW''' shortcut page and a '''non-HRW''' page, but you must do so with care: | ||
| + | *<code><nowiki>{{shortcut|SHORTCUT1||[[SHORTCUT3]]}}</nowiki></code> — will link to '''HRW:SHORTCUT1''' and '''SHORTCUT3''' respectively. | ||
| + | However, you '''must''' link to at least one page in the '''HRW''' namespace. | ||
| </noinclude><noinclude> | </noinclude><noinclude> | ||
| [[Category:Internal link templates|{{PAGENAME}}]] | [[Category:Internal link templates|{{PAGENAME}}]] | ||
| </noinclude> | </noinclude> | ||
Revision as of 01:56, 28 April 2007
Shortcut:
[[HRW:{{{1}}}]]
[[HRW:{{{1}}}]]
Usage:
When linking to a shortcut in the HRW Pseudo-namespace, simply enter the target name (without the namespace) as a template parameter:
- {{shortcut|SHORTCUT1}}— automatically links to HRW:SHORTCUT1 (Note that the HRW: pseudo-namespace is automatically added)- or
 
- {{shortcut|SHORTCUT1|SHORTCUT2}}— automatically links to HRW:SHORTCUT1 and HRW:SHORTCUT2- or
 
- {{shortcut|SHORTCUT1|SHORTCUT2|[[HRW:SHORTCUT3]]}}— same as above, except the third parameter requires extra formatting since it's a free-for-all. As shown, it links to HRW:SHORTCUT3, but you could string any number of extra links in the form:- [[HRW:SHORTCUT3]]<br>[[HRW:SHORTCUT4]]— adds links to HRW:SHORTCUT3 and HRW:SHORTCUT4
- [[SHORTCUT3]]<br>[[HRWiki:SHORTCUT4]]— adds links to SHORTCUT3 and HRWiki:SHORTCUT4
 
This last parameter is used when you need to link to non-HRW pages or the page containst more than two shortcuts. You may link to an HRW shortcut page and a non-HRW page, but you must do so with care:
- {{shortcut|SHORTCUT1||[[SHORTCUT3]]}}— will link to HRW:SHORTCUT1 and SHORTCUT3 respectively.
However, you must link to at least one page in the HRW namespace.
