Answer the question
In order to leave comments, you need to log in
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
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}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question