[[+content_image]]
I
I
iAlex1952019-05-21 14:16:25
MODX
iAlex195, 2019-05-21 14:16:25

How to display a record in two different versions?

Hello!
Created a tv parameter checkbox. When displaying in a template via pdoResources, you need to set &tpl depending on the selected checkbox.
Output code in the template

[[!pdoResources?
                        &parents=`0`
                        &resources=`-1`
                        &limit=`3`
                        &includeTVs=`big_img, article_label, type_of_article`
                        &tvPrefix=`tv.`
                        &tpl=`articleTypeOneTpl`
                    ]]

Thus, it is impossible to display, it always selects &tpl in else.
Could you tell me how you can implement the selection of the display of the element?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
A
Anton Tarasov, 2019-05-21
@an-tar

Are you sure that [[+tv.type_of_article]] is getting the right value here?
As an option, check the condition in the chunk itself.

I
iAlex195, 2019-05-21
@iAlex195

Resolved
Need to add:
&tplOperator,
&tplCondition,
&conditionalTpls.
https://docs.modx.pro/komponentyi/pdotools/obshhie...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question