Hello,
just a simple question, is there a better way to get root page id from dca plugin that fetching it step by step from database:
maybe it is already stored somewhere...? thanksPHP Code:
$pid = $dca->activeRecord ->pid;
do
{
$objPage = $this ->Database ->prepare("SELECT id,pid FROM tl_page WHERE id=?")
->limit(1)
->execute($pid);
if ( $objPage->numRows < 1 )
{
break;
}
$rootId = $objPage->id;
$pid = $objPage->pid;
}
while ( $pid > 0 && $objPage->type != 'root' );
Bookmarks