Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Zegnåt’s multi-level navigation. ‘Menu Master.’ (version 3., 20100519)
#1
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!
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#2
This reply is where the documentation is going to come…
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#3
in my opinion your previous menu was wonderful, and plus menu_parent_child.php, just perfect...

but of course you will develop further
Reply
#4
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.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#5
I expect Smile
Reply
#6
Jag förväntar mig Smile
Reply
#7
you can write a plugin for directories?
Reply
#8
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!
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#9
Zegnåt how are things with your plugin?
Reply
#10
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…
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#11
Zegnåt Wrote:People haven’t even been replying to version 3
Maybe you need a wider beta base Smile
Reply
#12
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.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#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.
Reply
#14
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?
Reply
#15
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(); ?>
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#16
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!
"Dynamite's a very tricky sort of operation"
Reply
#17
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.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#18
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
"Dynamite's a very tricky sort of operation"
Reply
#19
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.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#20
Works like a charm, thanks a bunch!
"Dynamite's a very tricky sort of operation"
Reply
#21
hi.

cant get this working...tried a couple of days now ;(
Possible to make a manual with pictures?
Reply
#22
I think it would be good to make the ability to insert different menu
Reply
#23
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(); ?>
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#24
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(); ?>
Reply
#25
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.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply




Users browsing this thread: 4 Guest(s)