Difference between revisions of "Template:Forum link"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (Hmm. It looks like the #if macro doesn't work inside of an external link.)
m (Fix (?) cases where arguments are undefined.)
Line 1: Line 1:
{{#if: {{{threadName}}}<!--
+
{{#if: {{{threadName|}}}<!--
 
   -->|<!--
 
   -->|<!--
       -->{{#if: {{{postID}}}<!--
+
       -->{{#if: {{{postID|}}}<!--
 
         -->|[http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}}&#35;post{{{postID}}} Forum thread {{{threadID}}}, "{{{threadName}}}"]<!--
 
         -->|[http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}}&#35;post{{{postID}}} Forum thread {{{threadID}}}, "{{{threadName}}}"]<!--
 
         -->|[http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}} Forum thread {{{threadID}}}, "{{{threadName}}}"]<!--
 
         -->|[http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}} Forum thread {{{threadID}}}, "{{{threadName}}}"]<!--
 
       -->}}<!--
 
       -->}}<!--
 
   -->|<!--
 
   -->|<!--
       -->{{#if: {{{postID}}}<!--
+
       -->{{#if: {{{postID|}}}<!--
 
         -->|[http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}}&#35;post{{{postID}}} Forum thread {{{threadID}}}]<!--
 
         -->|[http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}}&#35;post{{{postID}}} Forum thread {{{threadID}}}]<!--
 
         -->|[http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}} Forum thread {{{threadID}}}]<!--
 
         -->|[http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}} Forum thread {{{threadID}}}]<!--

Revision as of 01:52, 8 October 2012

Forum thread {{{threadID}}}

{{#if: {{{threadName}}}
   | {{#if: {{{postID}}}
      | [http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}}#post{{{postID}}} Forum thread {{{threadID}}}, "{{{threadName}}}"]|
      | [http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}} Forum thread {{{threadID}}}, "{{{threadName}}}"]
     }}
   | {{#if: {{{postID}}}
      | [http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}}#post{{{postID}}} Forum thread {{{threadID}}}]|
      | [http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}} Forum thread {{{threadID}}}]
     }}
}}

See http://www.mediawiki.org/wiki/Help:Templates#Default_values for more information.

Template

Usage Produces
{{forum link | threadID=12406}}
 Forum thread 12406
{{forum link | threadID=12406 | threadName=Show off your awesome KSP Pictures}}
 Forum thread 12406, "Show off your awesome KSP Pictures"
{{forum link | threadID=12406 | postID=182021}}
 Forum thread 12406
{{forum link | threadID=12406 | threadName=Show off your awesome KSP Pictures | postID=182021}}
 Forum thread 12406, "Show off your awesome KSP Pictures"