Difference between revisions of "Template:Forum link"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (Fix (?) cases where arguments are undefined.)
(-code of the template; +table for the parameter; !use new links; *simplified the code;)
Line 1: Line 1:
{{#if: {{{threadName|}}}<!--
+
[http://forum.kerbalspaceprogram.com/threads/{{{threadID}}}{{#if: {{{postID|}}}|&#35;post{{{postID}}}}} {{{text|Forum thread {{{threadID}}}{{#if: {{{threadName|}}}|, "{{{threadName}}}"}}}}}]<noinclude>
  -->|<!--
 
      -->{{#if: {{{postID|}}}<!--
 
        -->|[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}}}"]<!--
 
      -->}}<!--
 
  -->|<!--
 
      -->{{#if: {{{postID|}}}<!--
 
        -->|[http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}}&#35;post{{{postID}}} Forum thread {{{threadID}}}]<!--
 
        -->|[http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}} Forum thread {{{threadID}}}]<!--
 
      -->}}<!--
 
-->}}<noinclude>
 
  
<pre>
+
{{Parameter Table|parameters=
{{#if: {{{threadName}}}
+
{{Parameter Row|threadID|The ID of the thread}}
  | {{#if: {{{postID}}}
+
{{Parameter Row|postID|The ID of the post.|Not set}}
      | [http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}}&#35;post{{{postID}}} Forum thread {{{threadID}}}, "{{{threadName}}}"]|
+
{{Parameter Row|text|Custom link text.|<tt>Forum thread {{{threadID}}}</tt>}}
      | [http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}} Forum thread {{{threadID}}}, "{{{threadName}}}"]
+
{{Parameter Row|threadName|The name of the thread.|Not set}}
    }}
 
  | {{#if: {{{postID}}}
 
      | [http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}}&#35;post{{{postID}}} Forum thread {{{threadID}}}]|
 
      | [http://kerbalspaceprogram.com/forum/showthread.php/{{{threadID}}} Forum thread {{{threadID}}}]
 
    }}
 
 
}}
 
}}
</pre>
 
  
 
See http://www.mediawiki.org/wiki/Help:Templates#Default_values for more information.
 
See http://www.mediawiki.org/wiki/Help:Templates#Default_values for more information.

Revision as of 08:10, 22 November 2013

Forum thread {{{threadID}}}

Template:Parameter Table

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"