A
A
Alexander Ivanov2016-11-10 15:58:07
MODX
Alexander Ivanov, 2016-11-10 15:58:07

How to get parent id in TV?

//пока получилось только id ресурса
@EVAL 
$id = $modx->resource->get('id');
return "<SPAN style='color:red'>id ресурса ".$id."</SPAN>";

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ivanov, 2016-11-10
@cimonlebedev

@EVAL 
$parent = $modx->getObject('modResource', $modx->resource->get('parent'));
return "<SPAN style='color:red'>id ресурса ".$parent->get('id')."</SPAN>";

I understand how, but along the way, in my case, I will have to write a plugin

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question