M
M
Maks Hate2020-11-17 14:05:18
MODX
Maks Hate, 2020-11-17 14:05:18

Like in modx revo If else condition inside meta description?

Good afternoon. I want to create a condition if product description is filled, output description, and if description is empty, output parent.description, otherwise output string "This is description" Like

this:
{if $_modx->resource.description == 1}
{$_modx ->resource.description}
{elseif $_modx->resource.description == 0}
{$_modx->resource.parent.description}
{else}
This is description
{/if}

However when I pasted this piece of code, on the html page in meta description = "Empty".
Actually the question itself. How to properly describe all this and embed it in this tag (description)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Tarasov, 2020-11-17
@4elive8

Print separately
{$_modx->resource.description}
{$_modx->resource.parent.description}
What's in them? expected?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question