Template:extlinks

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
(tweak)
(add support for titles w/o quotes)
Line 1: Line 1:
-
{{#if:{{{nohtml|}}}||{{#if:{{{1|}}}|
+
{{#setvar:title|{{#if:{{{title2|}}}|{{{title2|}}}|"{{#if:{{{title|}}}|{{{title|}}}|{{PAGENAME}}}}"}}}}<!--
-
*{{el|{{{1|}}}.html|{{{action|watch}}} "{{{title|{{PAGENAME}}}}}"|{{{site|oldhr}}}}} {{#if:{{{site|}}}||on the old [[Flash]] site}}|}}}}<!--
+
  /* See if title2 is populated, otherwise use title (add quotes), if not default to PAGENAME (add quotes) */
 +
-->{{#if:{{{nohtml|}}}||{{#if:{{{1|}}}|
 +
*{{el|{{{1|}}}.html|{{{action|watch}}} {{#var:title}}|{{{site|oldhr}}}}} {{#if:{{{site|}}}||on the old [[Flash]] site}}|}}}}<!--
-->{{#if:{{{noswf|}}}||{{#if:{{{1|}}}|
-->{{#if:{{{noswf|}}}||{{#if:{{{1|}}}|
-
*{{el|{{#if:{{{swf|}}}|{{{swf|}}}|{{{1|}}}}}.swf|view the Flash file for "{{{title|{{PAGENAME}}}}}"|{{{site|oldhr}}}}}|}}}}<!--
+
*{{el|{{#if:{{{swf|}}}|{{{swf|}}}|{{{1|}}}}}.swf|view the Flash file for {{#var:title}}|{{{site|oldhr}}}}}|}}}}<!--
-
-->{{#if:{{{youtube|}}}|*[[YouTube:{{{youtube}}}|{{{action|watch}}} "{{{title|{{PAGENAME}}}}}"]] on [[YouTube]]}}<!--
+
-->{{#if:{{{youtube|}}}|*[[YouTube:{{{youtube}}}|{{{action|watch}}} {{#var:title}}]] on [[YouTube]]}}<!--
-
-->{{#if:{{{twitter|}}}|*[[Twitter:StrongBadActual/status/{{{twitter}}}|{{{action|watch}}} "{{{title|{{PAGENAME}}}}}"]] on {{#if:{{{y|}}}|{{prs|{{{twitter}}}|{{{d}}}|{{{m}}}|{{{y}}}|alt=Twitter}}|[[@StrongBadActual|Twitter]]}}}}<!--
+
-->{{#if:{{{twitter|}}}|*[[Twitter:StrongBadActual/status/{{{twitter}}}|{{{action|watch}}} {{#var:title}}]] on {{#if:{{{y|}}}|{{prs|{{{twitter}}}|{{{d}}}|{{{m}}}|{{{y}}}|alt=Twitter}}|[[@StrongBadActual|Twitter]]}}}}<!--
-
-->{{#if:{{{forum|{{{2|}}}}}}|*[[Forum:{{{forum|{{{2|}}}}}}|forum thread re: "{{{title|{{PAGENAME}}}}}"]]}}<noinclude>
+
-->{{#if:{{{forum|{{{2|}}}}}}|*[[Forum:{{{forum|{{{2|}}}}}}|forum thread re: {{#var:title}}]]}}<noinclude>
==Basic usage==
==Basic usage==
Line 48: Line 50:
|For pages where the toon's name doesn't match the wiki page name
|For pages where the toon's name doesn't match the wiki page name
|{{extlinks|filename|forum thread id|title=title}}
|{{extlinks|filename|forum thread id|title=title}}
 +
|-
 +
|
 +
<code>&#123;{extlinks|</code>''filename''<code>|</code>''forum thread id''<code>|title2=</code>''title2''<code>}}</code>
 +
|For pages where the toon's name doesn't match the wiki page name and we don't want to add double quotes
 +
|{{extlinks|filename|forum thread id|title=title2}}
|-
|-
|
|

Revision as of 10:12, 11 February 2021


Basic usage

  • {{extlinks|filename|forum thread id}}
    • The forum thread id can be left out, if the toon doesn't have a forum thread.

Other parameters that can be used

Parameter Description Example

{{extlinks|filename|forum thread id|site=Mirror}}

For pages on the HRWiki mirror (any other interwiki prefix can also be used, as long as the URL ends in .html or .swf)

{{extlinks|html filename|forum thread id|swf=swf filename}}

For pages where the Flash file has a different name to the HTML file

{{extlinks|swf filename|forum thread id|nohtml=1}}

For pages where the Flash file has no HTML file

{{extlinks|html filename|forum thread id|noswf=1}}

For pages where the HTML file has no Flash file

{{extlinks|forum=forum thread id}}

For pages with no HTML file or Flash file

{{extlinks|filename|forum thread id|title=title}}

For pages where the toon's name doesn't match the wiki page name

{{extlinks|filename|forum thread id|title2=title2}}

For pages where the toon's name doesn't match the wiki page name and we don't want to add double quotes

{{extlinks|filename|forum thread id|youtube=YouTube id}}

For YouTube videos

{{extlinks|filename|forum thread id|twitter=Twitter id|d=day|m=month|y=year}}

For Twitter links
If the date parameters are filled in, it will automatically link to the specific Tweet on the wiki

{{extlinks|filename|forum thread id|action=action}}

For pages that you don't watch

See Also

Personal tools