How to get the parent id in the TV?

//while it turned out only the id of the resource
@EVAL 
$id = $modx->resource->get('id');
return "<span style="color:red">id of the resource ".$id."</span>";
July 2nd 19 at 17:58
1 answer
July 2nd 19 at 18:00
Solution
@EVAL 
$parent = $modx->getObject('modResource', $modx->resource->get('parent'));
return "<span style="color:red">id of the resource ".$parent->get('id')."</span>";

Understand how, but during my case, you will have a plugin to write
Maybe the snippet yet? - jamison.Kreiger commented on July 2nd 19 at 18:03
: it happened. in General, you need to have the parent id automatically were substituted in TV, i.e. whatever the code was and immediately the number.
Need for the filter. - Hattie.Purdy28 commented on July 2nd 19 at 18:06
although I think I understand... - Hattie.Purdy28 commented on July 2nd 19 at 18:09
: still using the plugin because when you output via pdoTools it displays code tv - Hattie.Purdy28 commented on July 2nd 19 at 18:12
: Changed type of input : a list of single choice - autocomplete plugin and not have to write ) - Hattie.Purdy28 commented on July 2nd 19 at 18:15
: interesting solution - jamison.Kreiger commented on July 2nd 19 at 18:18

Find more questions by tags MODX