R
R
RushV2021-03-04 07:11:44
MODX
RushV, 2021-03-04 07:11:44

Is it possible to sort output in switch/case in fenom ModX?

Hello!
Is there any way to sort the output of case ?
Drag and drop doesn't work.

{foreach $blocks as $block}
           {switch $block}
                                {case "Брошуры и каталоги"}
                                     текст 2
                                {case "Патенты"}
                                    текст 1
            {/switch}
{/foreach}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arthur Sh, 2021-03-04
@Shev_Art_V

The code you posted should work, if it doesn't, then there are no valid values ​​in the input. To see if this is true write {$blocks | print_r} you will see the contents of the $blocks array, and it will be clear where the error is.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question