CodeIgniter Forums
Menu Library 1.3 [05 Gen 09] - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Menu Library 1.3 [05 Gen 09] (/showthread.php?tid=12294)

Pages: 1 2 3 4 5 6


Menu Library 1.3 [05 Gen 09] - El Forum - 10-17-2008

[eluser]Bob Sawyer[/eluser]
[quote author="Dewos" date="1224268528"]Ops.... Bugfix release.
Hope it's final Big Grin[/quote]

Hmmm... maybe not! The strrpos() bug is fixed but now the menu doesn't display at all! :-)


Menu Library 1.3 [05 Gen 09] - El Forum - 10-17-2008

[eluser]Dewos[/eluser]
[quote author="Bob Sawyer" date="1224269190"][quote author="Dewos" date="1224268528"]Ops.... Bugfix release.
Hope it's final Big Grin[/quote]

Hmmm... maybe not! The strrpos() bug is fixed but now the menu doesn't display at all! :-)[/quote]

My menu work Smile


Menu Library 1.3 [05 Gen 09] - El Forum - 10-17-2008

[eluser]Bob Sawyer[/eluser]
Hmm... I've got nothing. Instructions followed to the letter. Digging into the code now...


Menu Library 1.3 [05 Gen 09] - El Forum - 10-17-2008

[eluser]Bob Sawyer[/eluser]
Aha! Here's the problem. I was following the directions a little too closely. You have the following in the user guide, under "Direct Submit Mode":

Code:
<?php
$menu = array(
        anchor('home', 'Home'),
        anchor('about', 'About Us'),
        anchor('credit', 'Credit Page')
        );
                
$this->menu->create($menu);        
?>

When it actually should be:

Code:
<?php
$menu = array(
        anchor('home', 'Home'),
        anchor('about', 'About Us'),
        anchor('credit', 'Credit Page')
        );
                
echo $this->menu->create($menu);        
?>



Menu Library 1.3 [05 Gen 09] - El Forum - 01-04-2009

[eluser]freshface[/eluser]
What about this:

$config['user'] = array(
anchor('', 'Home'),
anchor('user/logout', 'Logout'),
anchor('user/settings', 'Settings'),
anchor('list/create', 'Create a list'),
anchor('lists', 'Manage lists'),
);

Now

anchor('user/logout', 'Logout'),
anchor('user/settings', 'Settings'),

Get marked as current, but i just wont the active url and not the one that contains user


Menu Library 1.3 [05 Gen 09] - El Forum - 01-05-2009

[eluser]MikeHibbert[/eluser]
Hey Dewos

I have been making similar code for projects I've been doing an I thought you might benefit from some of my experiences.

I made a menu_view that can roll through a set of CI database results and create the items from that.

This is great for when you are taking menus items from a database that has different sections and departments etc. All you do is add to the CI DB result object and the menu will display them all automagically Big Grin

I'm not saying this is the best or better way but I thought I might share an idea

Mike


Menu Library 1.3 [05 Gen 09] - El Forum - 01-05-2009

[eluser]Dewos[/eluser]
[quote author="freshface" date="1231100120"]What about this:
Get marked as current, but i just wont the active url and not the one that contains user[/quote]

Similar bug Fixed in 1.3, but not tested. Time is tiny...

The Views support is easy, let me know if anyone need this.

Happy NewY.


Menu Library 1.3 [05 Gen 09] - El Forum - 01-05-2009

[eluser]Référencement Google[/eluser]
Personally I prefer your library simple and tiny as it is now. Views are project specific, but I am not against see the code if somebody make it.


Menu Library 1.3 [05 Gen 09] - El Forum - 01-05-2009

[eluser]Dewos[/eluser]
[quote author="Too Pixel" date="1231195888"]Personally I prefer your library simple and tiny as it is now. Views are project specific, but I am not against see the code if somebody make it.[/quote]

Me too. :beer:


Menu Library 1.3 [05 Gen 09] - El Forum - 01-08-2009

[eluser]sofbas[/eluser]
[quote author="Dewos" date="1231195159"]

Similar bug Fixed in 1.3, but not tested. Time is tiny...
[/quote]

Hi, this broke single segment menus.

I changed the code to the following:
Code:
return (strripos($match, "/" . $segment) == TRUE) ? ' class=" ' . $current_tag .'"' : NULL;

i.e removed "/" after $segment and this fixed the problem. I don't if I am an isolated case...