T
T
tigra2015-12-17 16:00:29
PHP
tigra, 2015-12-17 16:00:29

How to write a condition in ModX?

I need a condition, if the
field is empty, then display , and if it is filled, then display
in php, everything is clear, but I can’t figure it out at all

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Ruslan, 2015-12-17
@tigroid3

As an option - do it through input-output modifiers, see docs.modx.pro/system/the-basics/filters-input-and-...
Specifically, in your case, as I understand it, this is for meta tags, it will be So:

<meta name="description" content=""/>

6
65536, 2015-12-17
@65536

https://rtfm.modx.com/extras/revo/if

A
Alex-1917, 2018-02-04
@alex-1917

Suddenly, someone still hasn’t mastered the basics and will come across here from Google))
It can be even more convenient:
One of three fields will be used in descending order of precedence:

  1. description field
  2. longtitle field
  3. pagetitle field

R
Roman, 2018-07-18
@RGBPlus

It seems to me that the code would be neater like this:

<meta name="description" content=""/>
// или 
<meta name="description" content="Вопрос">

Why write footcloths?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question