Sorry never used @EVAL I can’t really help... one thing I noticed as an intensive forum user, is forum activity is slowing down spectacularly since the beginning of July... vacation time it seems ! I know because now I can keep up with the forum
I hope someone drops by to help, but it might take more time than usual to get it...
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
I hope so cause This issue drives me crazy.
I’ve read every thread about @EVAL but any mentionned technics worked for me.
That’s really odd. If I’m putting this code in the default value field,
@EVAL return $modx -> runSnippet(’UltimateParent’);
Modx send me back the value.
The same code in optionnal value doesn’t send anything.
I woudn’t like to duplicate my TV and My template to figure out this issue.
:-)
maybe it’s just the format of your $values variable that does not fit...
$values = "value1-FR||value2-FR||valueN-FR";
either try:
$values = "value1==FR||value2==FR||valueN==FR"; (i.e. you need the ’==’ )
or leave it in rows and columns, as it is stated in
http://modxcms.com/what-are-at-bindings.html:
controls that accept string values such as a radio button group or select list will attempt to convert a record set (rows and columns) into the following format:
col1row1Value==col2row1Value||col1row2Value==col2row2Value,...
Thx for your help
but the issue doesn’t come from the values
I’ve given these as an example.
For now I cannot get that the php code be interpreted if entered in optional value field.
the same code in default value field of TV works well.
AS I told if i’m testing a simple snippet call with runSnippet function, It doesn’t send back any value.
:-)
As far as I know and after testing several way to write it, it seems that default value and optionnal are not handled in the same way by MODx.
With default value this syntax works.
in the default field:
@chunk mychunk
in mychunk:
@eval return $modx->runSnippet(’UltimateParent’);
Works as expected but the same call in optionnal values field doesn’t.
Could a member of the core confirm that the fields are not managed in the same way by MODx
thx.
:-)