Answer the question
In order to leave comments, you need to log in
Modx Revo 2.4.2. How to insert the value of any TV into a snippet?
Please tell me how to put the value of any TV in the snippet.
For example, this is how you can put a chunk
And how to insert TV?
Answer:$modx->getChunk('footer');
$modx->getObject('modTemplateVar', array('name' => имя_тв))->getValue(ид_ресурса)
Answer the question
In order to leave comments, you need to log in
This is why I hate mods. I don't know, maybe there is some normal way. I got out like this:
Made additional fields
Created a special template made these fields available to him
Created a resource using this template
Stuffed myself with a tattoo with the identifier of this resource so as not to forget
Made a special snippet
And called where necessary indicating the desired TV
This is horror, but more for me nothing came to mind
There is such a snippet - fastField, where TVs are called in this way:
where: 10 is the id of the desired resource.
Those. output a snippet within a snippet, it should work.
Vasily Naumkin made an excellent pdoField snippet, it is part of the pdoTools extension. Works very quickly and conveniently.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question