"; $levelprev = ""; $levelnow = ""; $firstlevelever = "false"; // set this to true first time top level nav comes. Avoiding wrong
if nav starts with child $counterfirstlevel = 0; foreach($storyboard['items'] as $storycounter => $values) { //print "
";print key($values);print_r($values);print "
";//??? $story = $values[key($values)]; // get the story into an array without the key if(isset($story['navlevel'])) { $levelprev = $levelnow; $levelnow = $story['navlevel']; //print "\n"; // close lists properly if($levelprev == "child" && $levelnow == "first-level" && $firstlevelever == "true") { print " "; } $navtitle = trim($story['title']); if(isset($story['navtitle'])) { // navtitle allows to set a specific title for the navigation if(trim($story['navtitle']) != "") { $navtitle = trim($story['navtitle']); } } if($story['navlevel'] == "child") { print "
  • ".$navtitle."
  • "; } if($story['navlevel'] == "first-level") { $firstlevelever = "true"; // set this to true first time top level nav comes. Avoiding wrong if nav starts with child $counterfirstlevel++; print "
  • ".$counterfirstlevel."

    ".$navtitle."

      "; } } } if($firstlevelever == "true") { // this only needs to be closed IF there has ever been a tree-style navigation print "
  • "; } print "
    "; ?> {{> social}}