Hi Folks,
There is a new version - now with a breadcrumb trail!
I've create a new post and attached the new file.
Full documentation is inside the archive!
Please note, I've UPDATED the code and commented on it here.
While not strictly grocerycrud I'm sharing here in an effort to give back a little.
I needed a simple menu system and I've used the Superfish jquery library before.
I did merge it into the fuelcms menu but I wasnt happy with it.
This is simpler to use and really easy to get a good looking menu out of a few lines of code.
here's all you have to do to use the library (after you've installed as per the included instructions)
$this->load->library('superfish', array('container_tag_id'=>'admin_menu', 'container_tag_id'=>'nav', 'container_tag_class'=>'sf-menu', 'background_color'=>'FFD833', 'highlight_color'=>'FAC101', 'text_color'=>'670001')); //make a shortcut to superfish $SuperFish=$this->superfish; //the same name as the load->library statement $SuperFish->set_menu_item('home','Home',$active_item); $SuperFish->set_menu_item('admin/usr_accounts','Administrative Tasks/Manage User Accounts',$active_item); $SuperFish->set_menu_item('admin/site_man','Administrative Tasks/Perform Site Management Tasks',$active_item); $menu=$SuperFish->render();
Note the change in my example - I made a small mistake that Elgger picked up. Thanks Elgger
the following is only necessary if you want to merge css and js with grocery crud
//merge our includes $arr=$menu->includes->css_files; foreach ($arr as $key => $value){ $css_files[$key]=$value; } $arr=$menu->includes->js_files; foreach ($arr as $key => $value){ $js_files[$key]=$value; } $output->inline.=$menu->includes->inline; $output->js_files=$js_files; $output->css_files=$css_files; $output->menu=$menu->output;
I've updated the code. (The attached file has been modified to include the change)
To do a vanilla render :
$menu=$this->superfish->render(); //or if you made a shortcut like above //$menu=SuperFish->render();
To render AND merge with crud output
$output=$this->menu->renderToCrud($output);//or if you made a shortcut like above //$output=$SuperFish->renderToCrud($output)
and in your template , if you've done the above merge :
<?php print $menu; ?>
Feedback is welcome but so is maintenance - if its broke feel free to fix it
if you need help just ask
Hope its useful to someone
Cheers
Ez