0

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"> 
}}
Bergi
  • 630,263
  • 148
  • 957
  • 1,375
MIlan Modh
  • 95
  • 9
  • 1
    What is not working? Do you get an error message? Do you have ParserExtensions installed? How do you include the template? – Bergi Feb 14 '14 at 09:04

1 Answers1

1

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">
}}
poke
  • 369,085
  • 72
  • 557
  • 602