MIlan Modh
MIlan Modh

Reputation: 95

If condition in mediawiki not working so that please help me

i want to display image when hideDiploma field is not 1. i will try for that but not working

the code as follow:

{{
#if:{{{hideDiploma|}}}|<div class="image" style="display:none;">|<div class="image"> 
}}

Upvotes: 0

Views: 256

Answers (1)

poke
poke

Reputation: 387697

when hideDiploma field is not 1

Note that you are only checking if the parameter was actually set to anything. If you want to check for equality with 1, you could do it like this:

{{ #ifeq: {{{hideDiploma|}}} | 1
| <div class="image" style="display:none;">
| <div class="image">
}}

Or if you want to allow multiple values, e.g. yes and y, you could use a switch:

{{ #switch: {{{hideDiploma|}}}
| 1 | yes | y = <div class="image" style="display:none;">
| #default = <div class="image">
}}

Upvotes: 1

Related Questions