A
A
Anna2020-02-12 11:06:29
MODX
Anna, 2020-02-12 11:06:29

In the product list, the checkbox property is displayed only by default. How to display product value in product list?

Good day! I'm a complete newbie to modx, so this might sound like a dumb question.

Task: there is a list of goods. In it, you need to display the phrase "Available in the demo" if the product itself has a checkmark in the TV property, and display nothing if the checkbox is not checked.
I output the property through pdoResourses with the corresponding chunk. The problem is that if I set the property to default in the TV field, then only it is displayed regardless of the choice in the card. If there is nothing by default, then nothing is displayed, regardless of whether the checkbox is checked or not.
Tell me, please, how can I check the checkbox and how can I display the desired values? (I tried another list with one choice - the same nonsense).

Output: [ [!pdoResources? &limit=`1` &parents=`[ [*id] ]` &tpl=`showRoom_tpl` &includeTVs=`showRoom` ] ]

Chunk: [ [+tv.showRoom:is=`1`:then=`Available in demo room `:else=``] ]

Possible values: Available==1, Default value :0

Thanks in advance for your help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Tarasov, 2020-02-12
@an-tar

remove the default value. leave Possible values: Available==1
Check the snippet call again. first, make sure that it gives the value - when the checkbox is checked (the checkmark is saved, right?! it just happens that there is an error in the backend, and this is not immediately visible) it should be non-empty .. when removed - empty.
If this is true, you can already hang a condition.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question