paw.MoreLevels
Posted: Sat Jun 15, 2019 8:29 pm
Has anyone already generated a 3-level navigation? How can I address the child-child element?Please ask for information and help.
Thank you.
Thank you.
Code: Select all
$data = $pages->getPublishedDB(); // Get published Page Keys
$count = 0;
do{
$item = new Page(current($data)); // Get current Page Object
$next = next($data); // Get next Page Key
prev($data); // Reset $data Array
// Just a Basic Example
echo str_repeat("- ", $count) . $item->title() . "<br />";
if(substr_count($next, "/") > $count){
$count++;
} else if(substr_count($next, "/") < $count){
$count -= ($count - substr_count($next, "/"));
}
} while(next($data));