I
I
its2easyy2018-12-05 12:56:56
MODX
its2easyy, 2018-12-05 12:56:56

How to check if the tv value of another resource is empty?

The main page has a tv with an image that will be used on different pages and different templates. I was able to get the value of tv via . There is a chunk in which you need to check the value of the field and if it is not empty, then output html

<div>
    <img src="">
</div>

Is there a way to wrap this block in an if? Or does it need to be done differently in modx?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Tarasov, 2018-12-05
@its2easyy

You can do this, first put the output of pdoField in a placeholder:
And then check for non-emptiness

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question