Topic on Extension talk:ParserFunctions

#if:A or B display text

6
Peachey88 (Flood) (talkcontribs)

I am trying to make a template display text if A or B has anything. like instead of:

{{#if:{{{A|}}}|text text text}}

have it do:

{{#if:{{{A|}}} or {{{B|}}}| text text text}}

Is there a way to do this?

This post was posted by Peachey88 (Flood), but signed as Cla1067.

Peachey88 (Flood) (talkcontribs)
{{#if:{{{A|}}}{{{B|}}}| text text text}}

untested, but should work ;-)

This post was posted by Peachey88 (Flood), but signed as Cboltz.

Peachey88 (Flood) (talkcontribs)

Awesome thank you! I guess the way it worked didn't process in my head for some reason.

This post was posted by Peachey88 (Flood), but signed as Cla1067.

84.111.101.105 (talkcontribs)

How do you the same only #if:A AND B (not empty) display text?

Will this work:

{{#if:{{{A|{{{B|}}}}}}| text text text}}
Technical 13 (talkcontribs)

Simple answer:

{{#if:{{{A|}}}|{{#if:{{{B|}}}|Text to display}}}}
80.201.99.238 (talkcontribs)

I want to display the text None specified if parameter 1 & 2 are empty. Nothing mentioned above seems to work.

Code:

{| style="border:1px solid #7F5000;width:100%"
   ! style="height:32px;background:#7F5000;color:#f0f0f0" | Stub
   |-
   ! style="background:#f0f0f0;color:black" |
   This article is a [[:Category:Article stubs|stub]]. You can help {{SITENAME}} by  [{{fullurl:{{FULLPAGENAME}}|action=edit}} expanding it].
   |-
   | style="background:#f0f0f0;color:black;padding:5px" | <div class="mw-collapsible mw-collapsed">Aditional Info:
   <div class="mw-collapsible-content">
   {{#if:{{{1|}}}|This page lacks: ''{{{1|}}}.''}}
   {{#if:{{{2|}}}|{{{2|}}}}}
   </div></div>
   {{#if:{{{1}}}{{{2}}}| |''None specified''}} //This line should display ''None specified'' if no parameters are specified.
   |}
Reply to "#if:A or B display text"