J
J
jeka-32021-04-05 10:43:06
MODX
jeka-3, 2021-04-05 10:43:06

How to withdraw from another context?

I need to output the name field from one context to another

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Tarasov, 2021-04-05
@jeka-3

Are you talking about variables again?) Try writing a snippet like this:

<?php
$modx->switchContext($desiredContextKey);
$fieldValue = $xpdo->getOption('name');
return $fieldValue; // ну или еще что-то сделайте со значением, что нужно в вашей задаче

And call the snippet in the right context

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question