开发者

Unfolding menus on DjangoCMS?

开发者 https://www.devze.com 2023-02-07 15:16 出处:网络
If I have nested pages, is it possible for, for example, the top level menu items only to show, but when I view a page, for its subpages to appear in the navigation?

If I have nested pages, is it possible for, for example, the top level menu items only to show, but when I view a page, for its subpages to appear in the navigation?

So for this structure:

  • Page 1
  • Page 2
    • Page 2a
    • Page 2b
  • Page 3

When I visit page 1 I see:

When I visit page 2 I see:

  • Page 1
  • Page 2
    • Page 2a
    • Page 2b
  • Page 3

When I visit page 3 I see:

  • Page 1
  • Page 2
  • Page 3
    • Page 3a
    • Page 3b


Yes it is possible and easy. Documentation on the show_menu template-tag explains how to do it.

You need to set extra_active argument to 1, like this:

{% show_menu 0 100 0 1 %}

Here are the names of each argument:

{% show_menu start_level end_level extra_inactive extra_active %}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号