Not show DIV when no input value for template-variable in MODx -


my blog posts have either video or image, never both. video , image both template-variables in modx evolution cms. always, div section (be blank space/area) image show , below div video. want image show provided input template-variable image, , no blank space video div. similarly, when input template variable video, not want blank area/space div image space show.

div image:

<div class="image"> <img src="[*image*]"> </div> 

div video:

<div class="well"> <video width="400" controls>  <source src="[*video*]" type="video/mp4">   <source src="[*video*]" type="video/ogv"> </video>    </div> 

how display div when input image , not show space video div? or how display div when input video , not show space image div? if-then rule?

problem solved using phx , code...

[+phx:if=`[*video*]`:ne=``:then=`<div class="well"> <video controls="" width="400">  <source src="[*video*]" type="video/mp4">   <source src="[*video*]" type="video/ogv"> </video></div>`+]         </div> 

Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -