Y
Y
Yuri Chernyshev2011-10-22 16:26:15
MODX
Yuri Chernyshev, 2011-10-22 16:26:15

MODx Revolution: output in templates?

Good afternoon! There is such a task - on the page to display a list of product characteristics in a plate with 3 columns. The characteristics themselves are implemented using TV parameters (the checkbox, a checked state means that the characteristic is applicable to this product). How can they be displayed in a table, taking into account the fact that only those for which the checkbox is checked should be displayed?
Essentially, the question boils down to this: how to implement a conditional loop in the MODx revolution template?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton_from_Amber, 2011-10-22
@Anton_from_Amber

1. If this is an important moment in the site or active processing is planned (recalculations, pulling up other data), then I immediately write a snippet and work with the API. Get all the TV's of the document and loop through the passed template.
2. You can call Ditto and set a clipping filter for this TV (&filter=`tvname,false,2` ). Works great and more than standard.
3. The most stupid option is to display everything in the template with an indication of the class based on this TV. Style to specify display: none .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question