Hi! Thanks a lot for the effort. This is a really useful module.
I am having this problem: Siblings menu is not being shown for 2nd level pages.
I have the following pages at my Primary Links menu:
1. Home
2. About Us
3. Categories --- Submenu Tree enabled. Display as Block Menu.
3.1. Category 1 --- Siblingsmenu Tree enabled. Display as Block Menu.
3.2. Category 2 --- Siblingsmenu Tree enabled. Display as Block Menu.
When I navigate to (3), Submenu Tree correctly displays:
3.1. Category 1
3.2. Category 2
But when I navigate to either (3.1) or (3.2) Submenu Tree shows nothing (the block is even not rendered at all).
I have tried to debug it to see where exactly is the problem but I am afraid I am too new to Drupal coding.
What I have found so far is:
- When visiting (3), function submenutree_nodeapi is called 3 times (this confuses me, why 3 times?). On those 3 times function _submenutree_set_block_content is called and at line 411 it returns:
1st time: Returns $stored_content[$delta], where $delta == 0 and $stored_content[0] contains an array where the element content contains the expected information (ul element with (3)'s children.
2nd time: Same as 1st time.
3rd time: Returns $stored_content[$delta], where $delta == 0 and $stored_content[0] is an empty array.
Anyway, even the fact the 3rd call returns an empty array, (3) is displayed correctly: Showing the block with a Submenu Tree containing (3)'s children.
Now...
- When visiting either (3.1) or (3.2), function submenutree_nodeapi is called 2 times (this confuses me: Why 2 times? Or: Why just 2 times on this call?). On those 3 times function _submenutree_set_block_content is called and at line 411 it returns:
1st time: Returns $stored_content[$delta], where $delta == 1 and $stored_content[1] contains an array where the element content contains the expected information (ul element with (3.1)'s/(3.2)'s siblings.
2nd time: Returns $stored_content[$delta], where $delta == 0 and $stored_content[0] is an empty array.
Notes:
- On my Primary links, every page except 3.2 are marked as expanded.
Is this really a bug? Or am I doing something wrong?
Thanks a lot in advance.
Victor Marquez
Comments
Comment #1
vmarquez commentedA small typo correction:
The paragraph:
- When visiting either (3.1) or (3.2), function submenutree_nodeapi is called 2 times (this confuses me: Why 2 times? Or: Why just 2 times on this call?). On those 3 times function _submenutree_set_block_content is called and at line 411 it returns:
Should be:
- When visiting either (3.1) or (3.2), function submenutree_nodeapi is called 2 times (this confuses me: Why 2 times? Or: Why just 2 times on this call?).
On those 3 timesOn those 2 times function _submenutree_set_block_content is called and at line 411 it returns:Comment #2
bengtan commented> But when I navigate to either (3.1) or (3.2) Submenu Tree shows nothing
That's by design. There are no menu items under (3.1) or (3.2) so there is nothing to display.
Or have I misunderstood your issue?
Comment #3
vmarquez commentedHi bengtan,
Thanks for your answer.
Since as per my Primary Links...
3.1. Category 1 --- Siblingsmenu Tree enabled. Display as Block Menu.
3.2. Category 2 --- Siblingsmenu Tree enabled. Display as Block Menu.
... see: (3.1) and (3.2) have Siblingsmenu Tree enabled and Display as Block Menu.
Then, I assume that while viewing either (3.1) or (3.2) these pages should display a Siblingsmenu, containing links to both (3.1) and (3.2) (the current's page siblings). Am I right?
Thanks again. I appreciate your support.
Bests regards
Victor Marquez
Comment #4
vmarquez commentedComment #5
bengtan commentedYes.
When you are visiting (3.1) or (3.2), the Submenutree block should be empty, but the Siblingmenutree block should display links to both (3.1) and (3.2).
The Submenutree block and the Siblingmenutree block are two separate and distinct blocks. Do you have the Siblingmenutree block enabled for display?
Comment #6
vmarquez commentedWow!
I did not realized there were 2 different blocks. I've just added Siblingmenu Tree Display to the block and now it is working.
Thanks a lot bengtan!
And thank you for all the work with this terrific module.
Bests regards.
Victor Marquez
Comment #7
gintass commentedI wonder why it is designed like that? Or maybe I misunderstand something. I thought it makes most sense to have the same menu on all levels withing the same "branch" in the menu hierarchy. For example if you have structure like this:
1.
2.
2.2
2.2.1
2.2.2
2.3
3.
3.1
3.2
I would think that there would be two submenus - one for the branch 2 and another for the branch 3 and both of them would display the same items whether they appear on the 2nd, 3rd or whatever level in the same branch. For example I would expect that complete menu like this
2.
2.2
2.2.1
2.2.2
2.3
would display on all pages 2, 2.2, 2.2.1, 2.2.2, 2.3 etc. Unfortunately I noticed that as you go deeper in the hierarchy menu gets shorter.
I used to use "menu trim" module in Drupal 5 http://drupal.org/project/menu_trim , but it wasn't ported to Drupal 6 therefore I had to look for something else and I thought that with submenu tree I can achieve the same results, but so far I couldn't figure out how.
Also ideally I would want this menu for each branch to display automatically. That is how menu trim module used to work. You didn't have to enable this menu manually. I don't expect website managers to remember to do that, but that is not the main problem. Problem is that sibling menu on pages like these 2.2.1 and 2.2.2 would only display part of the menu
2.2.1
2.2.2
It wouldn't display links to parents in this hierarchy. while the whole submenu for this branch would be:
2.
2.2
2.2.1
2.2.2
2.3
This way people have no way of knowing where they are in the menu hierarchy since current menu item in the top level menu is not highlighted and breadcrumbs don't work either. Breadcrumbs only work if I'm in "Edit" mode on the page, but not "View". I hope that there is something I don't understand about this module and maybe someone can help me out.
Comment #8
gintass commentedI guess this thread gives an answer to my question:
http://drupal.org/node/296859 and I should look at the menu block module.