A
A
alex-bass2019-01-18 03:30:32
MODX
alex-bass, 2019-01-18 03:30:32

How to call a chunk variable in ModX depending on a condition?

Hello!
I create a template on ModX and slowed down on the next one..., I'm not strong in programming, I know a little html and css, modx just started to learn.
I need to create a single template in which there will be a chunk variable. Those. if a certain page of the site opens, then one chunk is executed, if another specific page, then the second chunk, and so on several times (more than 20). Please tell me how to implement it.
I googled on the Internet, and did not find an answer, maybe because of a small wealth of knowledge

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jimmy_hendrix, 2019-01-18
@alex-bass

You can do this, the options are: 1) Write your own snippet and check the current page id via api
(xpdo) and display the
desired chunk 3) Download pdo tools, and using fenom in the template code, make a block with conditions . Example:

{if $_modx->resource.id == 7?}
{include 'myChank'}
{/if}

S
Sanes, 2019-01-18
@Sanes

page id, as a chunk suffix.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question