MODX Community

Migx Restricted conditions: hide a form field

I have configured a MIGX TV which is accessible in two contexts (German and English part of my site). I now want to turn one of the input fields of my mMIGX form for the German context to be not accessible while keeping it accessible in the English context.
In the form tab of the MIGX configuration page, I found the “Restricted Conditions” field. As far as I can see, I could use snippets or output filters there to achieve my goal. However, I could not find any further documentation nor any example snippets.
My snippet for getting the context looks like this:

$id = (!empty($id) ? $id : $modx->resource->get('id')); //retrieve ID or use current resource
$page = $modx->getObject('modResource', $id);
$output = $page->get('context_key');
return $output;

How can I now make the return value affect the accessibility of the form field?

I think it is:

return ‘1’ for the case, where the field should be hidden.
return’’ for the case, where the field should be shown

Thank you very much for your fast response. Your suggested solution worked well and my request is resolved now.

I’m glad, if I could help. Could you mark the answer as solution, please? Thanks!

I tried to mark the answer as solution but w/o success (also at my recent posts). Can you please give me a hint how to do that?

Thats’ only possible in some of the categories, like “Support”. I’ve moved your topic, can you see it now? :wink:

All right, got it! Thank you for your support, Mark. Bruno’s answer has been marked as the solution now.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.