GetSimple Support Forum
Nested Menus Plugin - 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: Nested Menus Plugin (/showthread.php?tid=2354)



Nested Menus Plugin - chrisbloom7 - 2011-11-08

This is the support page for the Nested Menus plugin.

See the plugin page for that latest notes and install instructions.

This plugin provides a set of template tags to return or print the main navigation as a set of nested pages, i.e. child items under parent. Will return only public items that are set to be displayed in the menu.
Example

Suppose you have a set of pages defined in the admin area like so:

Code:
Page 1
Page 2
    Sub Page 1
    Sub Page 2
Page 3
Page 4
    Sub Page 3

For simplicity sake, let's assume that these are all public pages, set to display in the menu, with their menu prioritization in the same order.

Using the normal menu functions all of those pages would be displayed as a flat unordered list:

Code:
<li class="current  index"><a href="/" title="Page 1">Page 1</a></li>
<li class="page-2"><a href="/index.php?id=page-2" title="Page 2">Page 2</a></li>
<li class="page-2 sub-page-1"><a href="/index.php?id=sub-page-1" title="Sub Page 1">Sub Page 1</a></li>
<li class="page-2 sub-page-2"><a href="/index.php?id=sub-page-2" title="Sub Page 2">Sub Page 2</a></li>
<li class="page-3"><a href="/index.php?id=page-3" title="Page 3">Page 3</a></li>
<li class="page-4"><a href="/index.php?id=page-4" title="Page 4">Page 4</a></li>
<li class="page-4 sub-page-3"><a href="/index.php?id=sub-page-3" title="Sub Page 3">Sub Page 3</a></li>

Using Nested Menus, we end up with this instead:

Code:
<li class="current index first"><a href="/" title="Page 1">Page 1</a></li>
<li class="page-2 submenu"><a href="/index.php?id=page-2" title="Page 2">Page 2</a>
  <ul>
    <li class="sub-page-1 first"><a href="/index.php?id=sub-page-1" title="Sub Page 1">Sub Page 1</a></li>
    <li class="sub-page-2 last"><a href="/index.php?id=sub-page-2" title="Sub Page 2">Sub Page 2</a></li>
  </ul>
</li>
<li class="page-3"><a href="/index.php?id=page-3" title="Page 3">Page 3</a></li>
<li class="page-4 submenu last"><a href="/index.php?id=page-4" title="Page 4">Page 4</a>
  <ul>
    <li class="page-4 sub-page-3 first last"><a href="/index.php?id=sub-page-3" title="Sub Page 3">Sub Page 3</a></li>
  </ul>
</li>

Change log
Version 1.4 (Released 9-Nov-2011)
  • Fixed bug that would cause pages not marked for display in the nav to appear anyway
  • Added $echo argument to the get_nested_navigation function. It is true by default. Setting it to false will cause the function to return the menu HTML as a string instead of outputting it directly.
  • Added an event trigger to clear the cache after a page is deleted.
  • Added a check to make sure that a parent page is set to be displayed in the nav before adding any children to it. This should also prevent pages nested deeper than 1 level from mucking up the array.



Nested Menus Plugin - mvlcek - 2011-11-08

chrisbloom7 Wrote:Provides a set of template tags to return or print the main navigation as a set of nested pages, i.e. child items under parent. Will return only public items that are set to be displayed in the menu.

This functionality and much more is already implemented in the navigation part of the I18N plugin.


Nested Menus Plugin - chrisbloom7 - 2011-11-10

mvlcek Wrote:This functionality and much more is already implemented in the navigation part of the I18N plugin.

Oh, cool. I didn't need internationalization in my project so I never came across that plugin, and there didn't seem to be any stand-alone plugins that did what I needed.


Nested Menus Plugin - mvlcek - 2011-11-10

chrisbloom7 Wrote:
mvlcek Wrote:This functionality and much more is already implemented in the navigation part of the I18N plugin.

Oh, cool. I didn't need internationalization in my project so I never came across that plugin, and there didn't seem to be any stand-alone plugins that did what I needed.

It should be possible to just use the navigation part by installing only i18n_navigation of the I18N plugin zip.


Nested Menus Plugin - chrisbloom7 - 2011-11-10

mvlcek Wrote:It should be possible to just use the navigation part by installing only i18n_navigation of the I18N plugin zip.

If I need to use internationalization in any future project, I will keep that in mind. For now this plugin does exactly what I need and none of what I don't Smile Hopefully it will be useful to others looking for similar functionality.


Nested Menus Plugin - chrisbloom7 - 2011-11-10

Version 1.4 has been uploaded. See the plugin page for the change log.


Nested Menus Plugin - yojoe - 2011-11-13

Would it be possible to include a function, to show siblings of a specified parent by his URL/name ?


Nested Menus Plugin - chrisbloom7 - 2011-11-16

yojoe Wrote:Would it be possible to include a function, to show siblings of a specified parent by his URL/name ?

The Child Menu extension does what you need. It works great for showing a menu of child pages in a sidebar.


Nested Menus Plugin - jlm - 2011-11-16

Hello,

Have you an example that turns your online plugin?


Nested Menus Plugin - chrisbloom7 - 2011-11-16

jlm Wrote:Hello,

Have you an example that turns your online plugin?

See the Install Instructions section on the plugin page.


Nested Menus Plugin - yojoe - 2011-11-16

chrisbloom7 Wrote:The Child Menu extension does what you need. It works great for showing a menu of child pages in a sidebar.
Actually it doesn't.
It show only siblings of current page, and I was asking for displaying siblings of defined parent regardless of current page.

Fortunately Mvlcek's navi plugin offers such functionality, but it's not an out of box solution.


Nested Menus Plugin - chrisbloom7 - 2011-11-23

yojoe Wrote:
chrisbloom7 Wrote:The Child Menu extension does what you need. It works great for showing a menu of child pages in a sidebar.
Actually it doesn't.
It show only siblings of current page, and I was asking for displaying siblings of defined parent regardless of current page.

Ah, OK, I see what you are after now. I'm not really sure that falls into the scope of what Nested Menus is built for, nor is my plugin really optimized for that behavior. It is closer to what Child Menus aims to do, though currently that plugin is setup to only get the child menu for the current page, not a user-specified page. I would suggest building your own custom plugin to accomplish this, starting by saving the Child Menu plugin file as a different name and then hacking it up to do what you need. I've had to do that for a few plugins of my own when a very custom solution was required.


Nested Menus Plugin - yojoe - 2011-11-23

chrisbloom7 Wrote:Ah, OK, I see what you are after now. I'm not really sure that falls into the scope of what Nested Menus is built for, nor is my plugin really optimized for that behavior. It is closer to what Child Menus aims to do, though currently that plugin is setup to only get the child menu for the current page, not a user-specified page. I would suggest building your own custom plugin to accomplish this, starting by saving the Child Menu plugin file as a different name and then hacking it up to do what you need. I've had to do that for a few plugins of my own when a very custom solution was required.

As always It's a matter of time.
GS has a function which returns array with all pages, and it's a base material to create own menu structure.
But the fastest solution to have an aside menu on all pages, was using Mvlcek's navigation plugin.
Navi plugin was improved alot, and despite custom html structure, it covers almost all aspects of displaying navigation menus Wink


Nested Menus Plugin - qlwik1 - 2012-03-27

Great plugin, thanks! Smile


Nested Menus Plugin - richard2233 - 2012-05-02

chrisbloom7 Wrote:This is the support page for the Nested Menus plugin.

See the plugin page for that latest notes and install instructions....

Is it possible to get this plugin to hide the child menu until the parent is clicked on, then for all the child links to be displayed after?

Nice work by the way!

Richard


RE: Nested Menus Plugin - mrmagoo - 2020-04-21

In GS 3.3.16 I can't seem to find the template to add 
Code:
<?php get_navigation(); ?>

Any help would be appreciated.
Gene


RE: Nested Menus Plugin - Oleg06 - 2020-04-22

Code:
<?php get_nested_navigation(); ?>



RE: Nested Menus Plugin - mrmagoo - 2020-04-22

(2020-04-22, 00:01:31)Oleg06 Wrote:
Code:
<?php get_nested_navigation(); ?>

Oleg06, what template Sad


RE: Nested Menus Plugin - Oleg06 - 2020-04-22

https://prnt.sc/s3ij4t
https://prnt.sc/s3ijex
https://prnt.sc/s3ii60
https://prnt.sc/s3iit0


RE: Nested Menus Plugin - mrmagoo - 2020-04-22

Thanks Oleg06, I'm using Blue Marble. I'll check there.