I want to have a single select List Box TV with dynamic options based on Input Option. On every parent resource, there's a MIGX setup for categories and the List Box TV should be pulling from it and assign it to its child resources.
Let say the structure shows like this:
-Parent 1 (5)
--Child 1
--Child 2
-Parent 2 (6)
--Child 1
--Child 2
so the single select List Box TV would be assigned to all children whatever the parent may be. Every parent have MIGX setup for categories for its child resources. Let say above i have 2 Parent resources with IDs 5 and 6 respectively. Is it possible to retrieve those parent ID using @EVAL inside TV Input Option?
My code inside Input Option is like this:
@EVAL $output = $modx->runSnippet('getImageList',array('tvname'=>'article_categories','limit'=>'0','docid'=> '5','tpl'=>'categories_option_tpl','outputSeparator'=>'||'));return $output;
As you can see 'docid' is pointing to ID '5' w/c is not dynamic at all. I want it to be dynamic to whatever the child resource that TV assigned to. Code would be something like this (but this code doesn't work):
@EVAL $output = $modx->runSnippet('getImageList',array('tvname'=>'article_categories','limit'=>'0','docid'=> '$modx->resource->get('parent');','tpl'=>'categories_option_tpl','outputSeparator'=>'||'));return $output;
'docid' value is '$modx->resource->get('parent');' to pull the parent ID whatever the child resource is, but this doesn't work. But that should be the logic.
Any ideas?
Thanks