A
A
AlexRas2015-11-11 22:11:07
PHP
AlexRas, 2015-11-11 22:11:07

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

3 answer(s)
6
65536, 2015-11-11
@AlexRas

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

R
Ruslan, 2015-11-11
@ruslan_aleev

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.

M
Max Beetle, 2015-11-11
@zm_llill

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 question

Ask a Question

731 491 924 answers to any question