Hi,
i have two contexts (de|en) and want to fill in a TV by passing a context-related lexicon-entry into it OnDocFormSave.
I tried a few things, but only get the proper output for the standard context (de), not my second context (en). For the second context the output is the unprocessed lexicon placeholder itself.
I tried: $modx->lexicon('my.placeholder'); outputs the de-value in both contexts $modx->lexicon('my.placeholder', array(), 'de'); standard context, works fine $modx->lexicon('my.placeholder', array(), 'en'); second context, outputs my.placeholder
I also tried $modx->lexicon->load('en:namespace:default'); without luck
Yes, the cultureKey is set correctly for both contexts. [[++cultureKey]] works as expected in the frontend.
No typos, namespace and topic values are correct.
Strangely, this here outputs “de” in each context:
$modx->lexicon->load('de:namespace:topic'); outputs the value for “de” in both contexts $modx->lexicon->load('en:namespace:topic'); outputs “my.placeholder”, which is the placeholder, not the value
So in order to pass in the cultureKey dynamically i need to fetch that.
Why does $modx->getOption('cultureKey'); output “de” in each context?
In fact: it doesn’t matter which SystemSetting i am trying to get. I always get the values from my main context using this: $modx->getOption('SettingName');
This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.