Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Child menu plugin
#1
Hi.
I have made a simple little child menu plugin that I thought I may share.
The goal of it is to make it fast and simple to get child pages to appear on parent/sibling pages.
Maybe it will come in handy for some of you.
You can get it on http://www.fohlin.net/tech-stuff/getsimp...enu-plugin
Cheers
Reply
#2
Your instructions:

Quote:You will need to call the event:
<?php exec_action('print_child_menu'); ?>
in the template.php document wherever you want to print the menu.

Wouldn't it be easier to call the function directly, instead of calling an event that calls the function? Like this:

Code:
<?php go_child_menu(); ?>
Reply
#3
very useful plugin
very simple
Reply
#4
Carlos Wrote:Wouldn't it be easier to call the function directly, instead of calling an event that calls the function? Like this:

Code:
<?php go_child_menu(); ?>

Hm... yes you are right.
I had it on the hook content-top first, but did not like it, so I just made the event instead.
It would probably be simpler and cleaner to call the function directly.
I will update the plugin and docs.

Thanks,
Erik
Reply
#5
I'm getting a bug Sad. I installed the plugin, replaced
Code:
<?php get_navigation(return_page_slug());        ?>
with
Code:
<?php go_child_menu(); ?>
and I get an empty <ul></ul> when I have a look with firebug. Nothing is showin' up, either. I don't have fancy urls on and am testing it in localhost (with the default setting using xampp). I installed it with easy-install, so I don't know if that makes a difference.
Sorry to be such a downer Sad

EDIT: By the way, nice site. I found the text "Start sidebar" though and wondered if it was meant to be there...
Anyway, I'd also like to point out you have the default favicon in your theme Smile.
Lol, just had another look and found a starting comment in the top right-hand corner of your theme Wink. (<!--).

Good luck!
GetSimple = awesome :). My GS website
Reply
#6
Hi.
Well, you should not replace
Code:
<?php get_navigation(return_page_slug()); ?>
It still needs to be there for the main menu.
Instead you should just add
Code:
<?php go_child_menu(); ?>
wherever you want the children/siblings menu to appear.

Thanks for pointing out the typos in the theme ;-) have not checked it that well myself.

Stew_822 Wrote:I'm getting a bug Sad. I installed the plugin, replaced
Code:
<?php get_navigation(return_page_slug()); ?>
with
Code:
<?php go_child_menu(); ?>
and I get an empty <ul></ul> when I have a look with firebug. Nothing is showin' up, either. I don't have fancy urls on and am testing it in localhost (with the default setting using xampp). I installed it with easy-install, so I don't know if that makes a difference.
Sorry to be such a downer Sad

EDIT: By the way, nice site. I found the text "Start sidebar" though and wondered if it was meant to be there...
Anyway, I'd also like to point out you have the default favicon in your theme Smile.
Lol, just had another look and found a starting comment in the top right-hand corner of your theme Wink. (<!--).

Good luck!
Reply
#7
I can't believe it's that simple and I missed it. Thanks erka! I'll test it out!
EDIT: Works fine Smile. Thanks!
GetSimple = awesome :). My GS website
Reply
#8
Thanks Erka! Works
Reply
#9
Child Menu v. 1.1 is available on http://www.fohlin.net/getsimple-child-menu-plugin
It has been cleaned up a bit with proper, GS recommended, file paths and storage of the cache files in the proper , GS recommended, location.

Enjoy.
Reply
#10
How can i get this to sort the sub-menu (ex A-Z)? It seems to just appear in a random order Sad Otherwise great plugin Smile
Reply
#11
Hi, I thought the sub-menu is sorted A-Z automatically, at least that is what happens on the servers I have. Maybe there is a difference in how your server reads the files. Do you have an example page where the sorting is random? I think this is not too hard to fix but I can not reproduce the issue.
kjemperud Wrote:How can i get this to sort the sub-menu (ex A-Z)? It seems to just appear in a random order Sad Otherwise great plugin Smile
Reply
#12
need to assign a class of active link
Reply
#13
Yes that would be good, but sadly with the current implementation it is not quite possible since there is only one sub-menu file per parent page. To get this the plugin would have to be re-designed a bit so that each child page also had its own sub menu file or something like that.
Oleg06 Wrote:need to assign a class of active link
Reply
#14
Hi.
Try the new version 1.4, it should sort the sub-menu A-Z in case it is not sorted automatically.
Remember to re-save some page after you upgrade the plugin to clear the cache.
kjemperud Wrote:How can i get this to sort the sub-menu (ex A-Z)? It seems to just appear in a random order Sad Otherwise great plugin Smile
Reply
#15
erka, it displays a parent link in my sidebar. How to get rid of it?

Services ( parent - domain.com/services/ )
Company formation ( child - domain.com/services/company_formation/ )

I need only:
Company formation ( child - domain.com/services/company_formation/ )

Services should remain only in the main menu block. Now I have 2 Services links - one in the main menu and 2nd in the sidebar.

Smile
Reply
#16
delete in line 95 <p id="parent"><a href="'.$XMLdata->url.'">'.$XMLdata->title.'</a></p>
delete in line 99 <p id="parent"><a href="index.php?id='.$XMLdata->url.'">'.$XMLdata->title.'</a></p>
Reply
#17
Oleg06 Wrote:delete in line 95 <p id="parent"><a href="'.$XMLdata->url.'">'.$XMLdata->title.'</a></p>
delete in line 99 <p id="parent"><a href="index.php?id='.$XMLdata->url.'">'.$XMLdata->title.'</a></p>

Yes, everything is OK.
But there are no any links at all in the sidebar if I go to the Home page. The sidebar is blank Smile
Reply
#18
this plugin works well, shows only link to parent page and child pages, if you want to display this menu in the sidebar on all pages you must use the components and write the menu manually
Reply
#19
Thank you Oleg!
Reply
#20
I forgot, there is still such a plugin
http://get-simple.info/forum/topic/770/g...rity-menu/
Reply
#21
It makes clones in the sidebar.

Main menu
Home
Services

Sidebar menu
Ноme
Services

I need:
Main menu
Home
Services

Sidebar menu
Company Formation
Offshore Registration
...................
...............
all these links are childs of parent one - Services
Reply
#22
here I've used this plugin, but when you add pages to be rewritten reference numbers
http://sex-after-18.com/adult-games
download
http://neowebtime.ru/gbp_menu.zip
Reply
#23
Yes, I can see your site - this is what I need.
But it does not work for me and I do not understand what is wrong.
I just get clones of the main menu in the sidebar.
Reply
#24
Assign page numbers and try to write them in code
<ul><?php gbp_menu(return_page_slug(),1,3); ?></ul>
or
<ul><?php gbp_menu(return_page_slug(),10,34); ?></ul>
Reply
#25
Sorry, I do not understand - what numbers, where are these numbers, where I can get these numbers, numbers of what?!

1. Олег, извини, не понимаю - какие такие номера, где их берут и как я могу их создать.

2. Не подскажешь по новостям. Не получается. Под новостью всегда находится блок сводки других новостей, а мне нужно как у тебя: http://neowebtime.ru/0/index.php?id=news...1%82%D0%B8

I do not understand why it looks like this. When I click the news title then I get a news text and excerpts of the rest news:

Quote:News Title #1
Nov, 20

Example blog contents description here. Example blog contents description here. Example blog contents description here. Example blog contents description here. Example blog contents description here.

News Title #2
Excerpt, excerpt, excerpt, excerpt, excerpt, excerpt, excerpt, excerpt, excerpt.

News Title #3
Excerpt, excerpt, excerpt, excerpt, excerpt, excerpt, excerpt, excerpt, excerpt.

News Title #4
Excerpt, excerpt, excerpt, excerpt, excerpt, excerpt, excerpt, excerpt, excerpt.

But it should be like this (only one news block per page):

Quote:News Title #1
Nov, 20

Example blog contents description here. Example blog contents description here. Example blog contents description here. Example blog contents description here. Example blog contents description here.
Reply




Users browsing this thread: 1 Guest(s)