Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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 · 3 comments

3 participants

Venelin Stoykov Patrick Lauber npardington
Venelin Stoykov

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)

Patrick Lauber
Collaborator

needs a pull request with tests.

npardington

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

npardington

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:
        ...
Patrick Lauber digi604 added this to the Some Day milestone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.