bryte
1
Hi all,
Just need to make a simple condition. But I’m stuck.
But I basically want to do is read a TV: [[*Headerclass]] in a template. if the output from the TV is " header" then HTML should be:
<div class="top-banner">
<div class="title-wrapper"><h1>¿Porque elegir Interiorisme?</h1></div>
<img src=" class="d-md-none top-banner-mobile" alt="">
</div>
Otherwise, just leave it empty.
Thanks!
bobray
3
Or a fairly short snippet with the tag where you want the output to appear:
[[!ShowHeader]]
/* ShowHeader snippet */
$tv = $modx->getTVValue('Headerclass');
return $tv == 'header'? '¿Porque elegir Interiorisme?' : "";
‘Headerclass’ can be replaced by the ID of the TV (no quotes) to speed things up slightly.
[[*Headerclass:is=`header`:then=`¿Porque elegir Interiorisme?`:else=``]]
nuan88
5
[[*Headerclass:is=header:then=`¿Porque elegir Interiorisme?`:else=``]]
I believe
1 Like