I think I found the problem, but I don’t know how to fix it.
UltimateParent returns the ID for level 2 if the is no level 3. But I don’t know which part I have to change to only return a id if there is a level 3.
with regards,
Ronald Lokers
'Front-end developer' @
h2o Media
I want to use 1 template for the whole site, so there must be some check that tell’s me if I am on a level 2 page that is a folder.
with regards,
Ronald Lokers
'Front-end developer' @
h2o Media
Would this help?
&parentClass - (parent)
CSS class denoting the menu item is a container and has children
You can try it with this snippet. It shows chunks related to the current level:
set the wayfinder call in a chunk
<?php
//
//GetChunkByLevel
//
//[[GetChunkByLevel? &chunks=`,,,@CODE<h4>Aufgaben:</h4>,@CODE<h4>Subaufgaben:</h4>` &debug=`0` ]]
//[[GetChunkByLevel? &chunks=`chunk0,chunk1,chunk3,projectlist,projectlist` &debug=`0` ]]
$chunks_arr = (isset($chunks))? explode(",",$chunks) : array(); // [ array ]
$debug = (isset($debug))? $debug :0;
$current_level = ( count( $modx->getParentIds( $modx->documentObject['id'] ) )+1 );// von Stefan
$output=$chunks_arr[$current_level];
if ($debug == '1'){
echo 'current_level '.$current_level.' ';
echo 'chunk '.$output;
}
if (substr($output,0,5) == '@CODE'){
$output = trim(substr($output,5));
}
else {
$output= "{{".$output."}}";
}
return $output;
?>