Difference between revisions of "Template talk:Stats table rocket fuel tanks"

From Kerbal Space Program Wiki
Jump to: navigation, search
Line 1: Line 1:
 
Does anybody know, how to make the last (NCS Adapter) visible only, when adapter=Yes switched on. -[[User:NWM|NWM]] ([[User talk:NWM|talk]]) 01:46, 27 May 2015 (UTC)
 
Does anybody know, how to make the last (NCS Adapter) visible only, when adapter=Yes switched on. -[[User:NWM|NWM]] ([[User talk:NWM|talk]]) 01:46, 27 May 2015 (UTC)
 +
:I've done it. The <nowiki>{{if||A|B|C}}</nowiki> and <nowiki>{{#if: A|B|C}}</nowiki> work almost the same (the former saves new lines while the latter does not):
 +
<pre>if A is not empty then:
 +
    return B
 +
else:
 +
    return C</pre> so <nowiki>{{#if: A||C}}</nowiki> returns only something (C) if A is empty. When we remove one pipe between them C will be visible if A is not empty (what you want). — [[User:XZise|xZise]] <small>&#91;[[User talk:XZise|talk]]&#93;</small> 14:19, 28 May 2015 (UTC)

Revision as of 14:19, 28 May 2015

Does anybody know, how to make the last (NCS Adapter) visible only, when adapter=Yes switched on. -NWM (talk) 01:46, 27 May 2015 (UTC)

I've done it. The {{if||A|B|C}} and {{#if: A|B|C}} work almost the same (the former saves new lines while the latter does not):
if A is not empty then:
    return B
else:
    return C
so {{#if: A||C}} returns only something (C) if A is empty. When we remove one pipe between them C will be visible if A is not empty (what you want). — xZise [talk] 14:19, 28 May 2015 (UTC)