show_menu_below_id doesn't work for pages without softroot if it is called from subpage of a softroot #1546

Open
vstoykov opened this Issue Dec 1, 2012 · 6 comments

Projects

None yet

5 participants

@vstoykov
Contributor
vstoykov commented Dec 1, 2012

I found problem with this. Lets explain with example tree structure:

  • home - ( id: home )
    • page in main tree 1
    • page in main tree 2
    • page in main tree 3
  • top-menu - ( id: top_menu ) ( softroot )
    • page in top menu 1
    • page in top menu 2
    • page in top menu 2

In the template I have:
{% show_menu_below_id "top_menu" 0 1 1 1 "top_menu.html" %}
and
{% show_menu_below_id "home" 0 1 1 1 "menu.html" %}

When I'm in some of the main pages the "top_menu" is rendered, but when I'm in some of the pages in top menu the main menu is not rendered. I understand that when I am on page that is inside a softroot I can't see pages that is outside this softroot. For default menu this is Ok, but when I want pages bellow id I actually want theese pages.

I'm using the latest stable release (2.3.4)

Member
digi604 commented Jul 11, 2013

needs a pull request with tests.

What would the downsides be to doing something like this:

cms/menu.py#L428

else:
    # if it's not a soft root and we haven't asked for a specific root, walk ancestors (upwards!)
    if not root_id:
        nodes = self.find_ancestors_and_remove_children(selected, nodes)

Maybe @evildmp could provide some insight

After looking a little more maybe this would be better:

cms/menu.py#L417

# if we found a selected 
# and haven't specified a root ...
    if selected and not root_id:
        ...
@digi604 digi604 added this to the Some Day milestone Feb 10, 2014
@FinalAngel FinalAngel referenced this issue Oct 19, 2015
Open

[META] Menus/pagetree refactor #4597

1 of 9 tasks complete
Owner

closed in favour of #4597

@FinalAngel FinalAngel closed this Oct 19, 2015
@czpython czpython referenced this issue Mar 29, 2016
Open

[META] Menus cleanup #5112

0 of 26 tasks complete
@czpython czpython reopened this Mar 29, 2016
Contributor

If this issue is related to this #3504 (which is already fixed)?

Owner

very much likely @vstoykov /cc @divio/django-cms-core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment