Hi,
i tried the firstChildRedirect snippet, but it seems not to work correctly.
I have this structure:
+mainfolder
++subfolder
+++subpage
++subpage
++anothersubpage
When i put the snippet in the mainfolder and click on the link at the webpage the anothersubpage appears.
How to get to the subfolder?
I modified the snippet by changing this:
/* Get children sorted
* FIXME: getActiveChildren is depecrated in 1.0
*/
$children= $modx->getActiveChildren($docid, $sortBy, $sortDir);
$targetid = isset ( $children[0]['id'] ) ? $children[0]['id'] : $default;
$url = $modx->makeUrl($targetid,'','','full');
return $modx->sendRedirect($url);
to this:
$children= $modx->getChildIds($docid, 1);
$targetid = $children[0];
$url = $modx->makeUrl($targetid,'','','full');
return $modx->sendRedirect($children[0]);
but then the resulting url doesn´t contain the alias, but the id of the subfolder.
How do i fix this?