GetSimple Support Forum
Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13)
+--- Thread: Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) (/showthread.php?tid=684)

Pages: 1 2 3 4


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Zegnåt - 2010-05-02

I’ve already moved on to work on version 4 so I thought it was time to share this one publicly.

Version 3.1 of my plugin has pretty much the same output as version 2, so ’til I find the time to write a new documentation check the old topic. One of the new things is that you will be in full control of how the menu is sorted through your admin panel. This enables you to sort the menu even by extra data added to the XML-file like the creation date or custom fields.

Download the plugin here.

The plugin should work with any language and in every GetSimple version starting from 2.0.



• • •



Now for the more important part that needs discussing, what features should be included in version 4?

This is the current plan, whenever I talk about “the main menu” I’m referring to the menu generated by menu_master():
  • Ability to switch sorting order between A-Z and Z-A.
  • Menu caching: ¹
    • Cache the exact menu HTML.
    • Cache the menu data so it can be used by other plugins.

  • Ability to choose what to do with submenu(s) in the main menu:
    • Always render the submenu(s) in the main menu,
    • only render the submenu for the active page in the main menu, or
    • never render the submenu(s) in the main menu.

  • Functions apart from rendering the main menu:
    • isParent() — Boolean, true when the current page has children.
    • isChild() — Boolean, true when the current page has a parent.
    • hasSubmenu() — Boolean, true when the current page has children that are set to show in the menu or when the current page has a parent and is set to show in the menu. *
    • submenu_master() — Renders only the menu of the current page’s children, or the menu of the current page’s parent. *

  • Custom hooks so you can make plugins for my plugin. *
  • Translation file so the plugin can be changed for any language.
  • Better HTML output. ²

*: I would like your opinion about what this feature should look like. How do you want it?
¹: When should the cache be generated? Every time you edit a page? Only when you edit the slug of a page? Maybe even only when you press the cache button? What do you think?
²: Do you think the HTML output of my previous menu plugin was bad? Let me know what you think the HTML of a menu should look like!


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Zegnåt - 2010-05-02

This reply is where the documentation is going to come…


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Oleg06 - 2010-05-03

in my opinion your previous menu was wonderful, and plus menu_parent_child.php, just perfect...

but of course you will develop further


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Zegnåt - 2010-05-03

Oleg06 Wrote:[...] plus menu_parent_child.php, just perfect...
To be fair, it gets far from perfect when you use Cumbe´s menu parent_child in combination with mine or any other menu. You will make your website a lot slower. I explained the problem in the original topic about the submenu code:
Zegnåt Wrote:First to build your normal page menu every data file is opened, read, processed and closed again. Then when you come to this piece of code it will again open, read, process and close every data file.
That's why one of the improvements with version 4 will be an integrated function to create the submenus.


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Oleg06 - 2010-05-03

I expect Smile


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Oleg06 - 2010-05-03

Jag förväntar mig Smile


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Oleg06 - 2010-05-03

you can write a plugin for directories?


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Zegnåt - 2010-05-04

Oleg06 Wrote:you can write a plugin for directories?
A plugin for what, exactly? Also, if it’s not about the menu plugin, please make a new topic about it!


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Oleg06 - 2010-05-12

Zegnåt how are things with your plugin?


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Zegnåt - 2010-05-13

Slow, I’m having exams at school and some other projects in the way.

People haven’t even been replying to version 3 much, even though it’s the first version with a page in the admin section. Wondering whether I should bother releasing version 4 at all…


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - badcat - 2010-05-13

Zegnåt Wrote:People haven’t even been replying to version 3
Maybe you need a wider beta base Smile


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Zegnåt - 2010-05-13

badcat Wrote:Maybe you need a wider beta base Smile
For version 4? Version 3 is published in the first post so I don’t really need a beta base there.


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - badcat - 2010-05-13

Zegnåt Wrote:...so I don’t really need a beta base there.
You're right - you don't need a beta base. I guess it's all in the attitude. Maybe a change in your sig might help.


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - mygetsimple - 2010-05-13

sorry ... I do not understand two things in the installation of your plugin:
1) the string: menu_master (); ... where where to put ... in which file? (You can specify the location please)
2) How does this plugin?


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Zegnåt - 2010-05-13

Just put the files from the ZIP-archive in the plugin folder. Then you edit your template.php file (of you theme) to call menu_master(). I don’t know where you want the menu, so I can’t tell you where in the file you want to put it.

As a general rule if your template has this somewhere:
Code:
<ul id="nav">
    <?php get_navigation(return_page_slug()); ?>
</ul>
You want to call my menu there using this code:
Code:
<?php menu_master(); ?>



Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - sysse - 2010-05-20

I have an issue with calling the function twice. In my case, I want a multi-level nav in my footer, but when I call the function a second time in the template, anything beyond the point of the function isn't rendered. Is it at all possible to call the function twice? Thanks!


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Zegnåt - 2010-05-20

I don’t know of any reason that would make it impossible to call the function twice. Enable debug mode in the gsconfig.php file and report back with the error, I’ll see what the problem is.


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - sysse - 2010-05-20

Here's the Error:
Quote:Fatal error: Cannot redeclare menu_sorting() (previously declared in /customers/sysse.se/sysse.se/httpd.www/getsimple/plugins/zegnat-multilevelnavigation.php:27) in /customers/sysse.se/sysse.se/httpd.www/getsimple/plugins/zegnat-multilevelnavigation.php on line 27



Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Zegnåt - 2010-05-20

Thank you for pointing out what a fool I am. I updated the plugin and it shouldn’t give any more problems.
Please redownload it.


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - sysse - 2010-05-20

Works like a charm, thanks a bunch!


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - maxpop - 2010-05-21

hi.

cant get this working...tried a couple of days now ;(
Possible to make a manual with pictures?


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Oleg06 - 2010-05-22

I think it would be good to make the ability to insert different menu


Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Zegnåt - 2010-05-22

maxpop Wrote:Possible to make a manual with pictures?
Not really, unless you want pictures of PHP code.
  1. Download the plugin,
  2. unzip it into the /plugins/ folder and
  3. change your template file to call this new menu somewhere.
Code needed for step three:
Code:
<?php menu_master(); ?>



Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - maxpop - 2010-05-22

Hi..

Thx for replying.

The submenu is always showing...solution?

//Maxpop


Zegnåt Wrote:
maxpop Wrote:Possible to make a manual with pictures?
Not really, unless you want pictures of PHP code.
  1. Download the plugin,
  2. unzip it into the /plugins/ folder and
  3. change your template file to call this new menu somewhere.
Code needed for step three:
Code:
<?php menu_master(); ?>



Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519) - Zegnåt - 2010-05-22

maxpop Wrote:The submenu is always showing...solution?
The solution is CSS.
Code:
ul.submenu { display: none; }
Will hide all submenus.

This plugin just gives you HTML for a menu with sub menus. If you want it to fit in with your layout you will need to add CSS and possible Javascript yourself.