Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
concertina menu script thing dingie
#1
Quick simple function, added in functions.php of template script
and then called by template <?php kry_menus_konsertina(); ?>

Code:
<?php

function kry_menus_konsertina(){
  $items =  menu_data();
    
  foreach ($items as $item) {
    if (($item['menu_status'] == 'Y') ) {
       if ($item['parent_slug'] == '') {
         $pItem[$item['menu_priority']] = array("url" => $item['url'],"slug" => $item['slug'],"menu_text" => $item['menu_text'],"parent" => $item['parent_slug'],"priority" => $item['menu_priority']);
       } else {
         if (isset($counterC[$item['parent_slug']])) {
           $counterC[$item['parent_slug']]++;
         } else {
           $counterC[$item['parent_slug']] = 1;
         }
         $cItem[$item['parent_slug']."_".$counterC[$item['parent_slug']]] = array("url" => $item['url'],"slug" => $item['slug'],"menu_text" => $item['menu_text'],"parent" => $item['parent_slug'],"priority" => $item['menu_priority']);
       }
        
    }
  }
  $actS = return_page_slug();
  for ($x = 0;$x <= 30; $x ++) {
     if (isset($pItem[$x])) {
        $slug = $pItem[$x]['slug'];
        $aktiev = false;
        if ($actS ==  $slug) {
          $aktiev = true;
        } else {
           if (isset($cItem[$pItem[$x]['slug']."_1"])) {
              $hoevC = $counterC[$pItem[$x]['slug']];
              for ($tmpX = 1; $tmpX <= $hoevC;$tmpX++) {
                 $tmpI = $cItem[$pItem[$x]['slug']."_$tmpX"];
                 if ($actS ==  $tmpI['slug']) {
                   $aktiev = true;
                 }
              }
           }
        }
        if ($aktiev ==  true) {
           echo "<div id='konsertina_hoof' class='konsertina_hoof'><a href='".$pItem[$x]['url']."'  class='".$pItem[$x]['slug']."'>".$pItem[$x]['menu_text']."</a>";
           if (isset($cItem[$pItem[$x]['slug']."_1"])) {
              echo "<div  class='konsertina_sub_items'>";
              $hoevC = $counterC[$pItem[$x]['slug']];
              for ($tmpX = 1; $tmpX <= $hoevC;$tmpX++) {
                 $tmpI = $cItem[$pItem[$x]['slug']."_$tmpX"];
                echo "<a href='".$tmpI['url']."'  class='".$tmpI['slug']."'>".$tmpI['menu_text']."</a><br/>";
              }
              echo "</div>";
           }
           echo "</div>";
       } else {
         echo "<div class='konsertina_hoof'><a href='".$pItem[$x]['url']."'  class='".$pItem[$x]['slug']."'>".$pItem[$x]['menu_text']."</a></div>";
       }      
     }
  }
   //error_log(print_r($pItem,true));  
   //error_log(print_r($cItem,true));  
  
}
?>

Hope it helps somebody.

tx
Stopped developing on GS Plugins. Anybody welcome to take the projects over. Thanks for all the support all.
Reply
#2
Johannes - this looks great, but what is it used with? From what i could tell from a Google search - its a type of Accordion jQuery-type Menu?
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#3
ccagle8 Wrote:Johannes - this looks great, but what is it used with? From what i could tell from a Google search - its a type of Accordion jQuery-type Menu?

Smile Hi there. Yes sorry translated kinda directly from my language.
Is the same idea yes, just all server based

sample site is

http://www.dominion-it.co.za/kliente/mar...id=fitness

Just check the Navigation menu's (all demo's )
will open up for active main menu item, you can control the sub menu's by settings there priority as normal menu items , for example sub menu item 1 = priority 1 etc.

hope I make sense, hope it can help somebody,.. just a quick and easy thing to add to template
Stopped developing on GS Plugins. Anybody welcome to take the projects over. Thanks for all the support all.
Reply




Users browsing this thread: 1 Guest(s)