A
A
Avguston2017-09-12 19:14:04
MODX
Avguston, 2017-09-12 19:14:04

How to put a condition on tv - a parameter in MODX?

Hello. I have such a question
How to put a condition on tv - a parameter in MODX? (now the output goes by id - this is bad)
There is, for example, TV - parameter
Depending on whether it is empty or not, I need to display a trail of info

{if $_modx->resource.id == 25}(Здесь должно быть условие тв - параметра)  
Какие - та слова с версткой
                            {else}
Очень длинный кусок кода

I saw that there is a construct like [*key:ifnotempty='[*key*]'] - but I can't fit all my code here. Maybe there is a structure likeif $_modx->TV.name !== NULL

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Froggyweb, 2017-09-12
@Froggyweb

{if $_modx->resource.id == 25 && $tvname =='1'}
Not working?

R
Roman, 2017-09-17
@RGBPlus

{switch $_modx->resource.id}
  {case '7'}
    код если id 7
  {case default}
    код по умолчанию
{/switch}

Like it should be

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question