Skip to content
This repository
Newer
Older
100644 178 lines (116 sloc) 4.359 kb
ebbc5661 »
2010-12-24 Changed documentation section styles to be consistent (and to the sec…
1 ##########
dd110f3b »
2009-01-21 docs about the navigation
2 Navigation
ebbc5661 »
2010-12-24 Changed documentation section styles to be consistent (and to the sec…
3 ##########
dd110f3b »
2009-01-21 docs about the navigation
4
c785e802 »
2009-07-05 some documentation improvements, including
5 There are four template tags for use in the templates that are connected to the menu:
c516c1c9 »
2009-09-17 documentation is now 100% sphinx compatible
6 ``show_menu``, ``show_menu_below_id``, ``show_sub_menu``, and ``show_breadcrumb``.
dd110f3b »
2009-01-21 docs about the navigation
7
ebbc5661 »
2010-12-24 Changed documentation section styles to be consistent (and to the sec…
8 *********
6b66d155 »
2009-09-15 docs converted to sphinx
9 show_menu
ebbc5661 »
2010-12-24 Changed documentation section styles to be consistent (and to the sec…
10 *********
dd110f3b »
2009-01-21 docs about the navigation
11
c516c1c9 »
2009-09-17 documentation is now 100% sphinx compatible
12 ``{& show_menu %}`` renders the navigation of the current page.
13 You can overwrite the appearance and the HTML if you add a ``cms/menu.html``
c785e802 »
2009-07-05 some documentation improvements, including
14 template to your project or edit the one provided with django-cms.
c516c1c9 »
2009-09-17 documentation is now 100% sphinx compatible
15 ``show_menu`` takes four optional parameters: ``start_level``, ``end_level``,
16 ``extra_inactive``, and ``extra_active``.
dd110f3b »
2009-01-21 docs about the navigation
17
c516c1c9 »
2009-09-17 documentation is now 100% sphinx compatible
18 The first two parameters, ``start_level`` (default=0) and ``end_level`` (default=100) specify from what level to which level
c1fce4d6 »
2009-07-09 A few more edits to the navigation documentation.
19 should the navigation be rendered.
20 If you have a home as a root node and don't want to display home you can render the navigation only after level 1.
dd110f3b »
2009-01-21 docs about the navigation
21
c516c1c9 »
2009-09-17 documentation is now 100% sphinx compatible
22 The third parameter, ``extra_inactive`` (default=0), specifies how many levels of navigation should be displayed
23 if a node is not a direct ancestor or descendant of the current active node.
dd110f3b »
2009-01-21 docs about the navigation
24
c516c1c9 »
2009-09-17 documentation is now 100% sphinx compatible
25 Finally, the fourth parameter, ``extra_active`` (default=100), specifies how many levels of
26 descendants of the currently active node should be displayed.
dd110f3b »
2009-01-21 docs about the navigation
27
ebbc5661 »
2010-12-24 Changed documentation section styles to be consistent (and to the sec…
28 Some Examples
29 =============
dd110f3b »
2009-01-21 docs about the navigation
30
6b66d155 »
2009-09-15 docs converted to sphinx
31 Complete navigation (as a nested list)::
dd110f3b »
2009-01-21 docs about the navigation
32
2b550e38 »
2009-03-30 docs
33 {% load cache cms_tags %}
34 <ul>
35 {% show_menu 0 100 100 100 %}
36 </ul>
dd110f3b »
2009-01-21 docs about the navigation
37
6b66d155 »
2009-09-15 docs converted to sphinx
38 Navigation with active tree (as a nested list)::
2b550e38 »
2009-03-30 docs
39
40 <ul>
41 {% show_menu 0 100 0 100 %}
42 </ul>
dd110f3b »
2009-01-21 docs about the navigation
43
6b66d155 »
2009-09-15 docs converted to sphinx
44 Navigation with only one active extra level::
2b550e38 »
2009-03-30 docs
45
46 <ul>
47 {% show_menu 0 100 0 1 %}
48 </ul>
dd110f3b »
2009-01-21 docs about the navigation
49
6b66d155 »
2009-09-15 docs converted to sphinx
50 Level 1 navigation (as a nested list)::
2b550e38 »
2009-03-30 docs
51
52 <ul>
53 {% show_menu 1 %}
54 </ul>
dd110f3b »
2009-01-21 docs about the navigation
55
6b66d155 »
2009-09-15 docs converted to sphinx
56 Navigation with a custom template::
7247cb3a »
2009-03-30 docs added
57
2b550e38 »
2009-03-30 docs
58 {% show_menu 0 100 100 100 "myapp/menu.html" %}
c1fce4d6 »
2009-07-09 A few more edits to the navigation documentation.
59
dd110f3b »
2009-01-21 docs about the navigation
60
ebbc5661 »
2010-12-24 Changed documentation section styles to be consistent (and to the sec…
61 *************
6b66d155 »
2009-09-15 docs converted to sphinx
62 show_sub_menu
ebbc5661 »
2010-12-24 Changed documentation section styles to be consistent (and to the sec…
63 *************
dd110f3b »
2009-01-21 docs about the navigation
64
f6261b30 »
2009-06-21 some doc changes by adball
65 Display the sub menu of the current page (as a nested list).
c1fce4d6 »
2009-07-09 A few more edits to the navigation documentation.
66 Takes one argument that specifies how many levels deep should the submenu be displayed.
c516c1c9 »
2009-09-17 documentation is now 100% sphinx compatible
67 The template can be found at ``cms/sub_menu.html``::
dd110f3b »
2009-01-21 docs about the navigation
68
2b550e38 »
2009-03-30 docs
69 <ul>
c1fce4d6 »
2009-07-09 A few more edits to the navigation documentation.
70 {% show_sub_menu 1 %}
2b550e38 »
2009-03-30 docs
71 </ul>
dd110f3b »
2009-01-21 docs about the navigation
72
6b66d155 »
2009-09-15 docs converted to sphinx
73 Or with a custom template::
7247cb3a »
2009-03-30 docs added
74
2b550e38 »
2009-03-30 docs
75 <ul>
c1fce4d6 »
2009-07-09 A few more edits to the navigation documentation.
76 {% show_sub_menu 1 "myapp/submenu.html" %}
2b550e38 »
2009-03-30 docs
77 </ul>
7247cb3a »
2009-03-30 docs added
78
ebbc5661 »
2010-12-24 Changed documentation section styles to be consistent (and to the sec…
79
80 ***************
6b66d155 »
2009-09-15 docs converted to sphinx
81 show_breadcrumb
ebbc5661 »
2010-12-24 Changed documentation section styles to be consistent (and to the sec…
82 ***************
dd110f3b »
2009-01-21 docs about the navigation
83
f6261b30 »
2009-06-21 some doc changes by adball
84 Show the breadcrumb navigation of the current page.
c516c1c9 »
2009-09-17 documentation is now 100% sphinx compatible
85 The template for the HTML can be found at ``cms/breadcrumb.html``.::
dd110f3b »
2009-01-21 docs about the navigation
86
c1fce4d6 »
2009-07-09 A few more edits to the navigation documentation.
87 {% show_breadcrumb %}
7247cb3a »
2009-03-30 docs added
88
8e2d444e »
2009-11-09 breadcrumb docs updated
89 Or with a custom template and only display level 2 or higher::
7247cb3a »
2009-03-30 docs added
90
8e2d444e »
2009-11-09 breadcrumb docs updated
91 {% show_breadcrumb 2 "myapp/breadcrumb.html" %}
7247cb3a »
2009-03-30 docs added
92
f6261b30 »
2009-06-21 some doc changes by adball
93 If the current URL is not handled by the CMS or you are working in a navigation extender,
94 you may need to provide your own breadcrumb via the template.
95 This is mostly needed for pages like login, logout and third-party apps.
7247cb3a »
2009-03-30 docs added
96
dd110f3b »
2009-01-21 docs about the navigation
97
c516c1c9 »
2009-09-17 documentation is now 100% sphinx compatible
98 .. _extending_the_menu:
99
100
ebbc5661 »
2010-12-24 Changed documentation section styles to be consistent (and to the sec…
101 *******************************************
f6261b30 »
2009-06-21 some doc changes by adball
102 Properties of Navigation Nodes in templates
ebbc5661 »
2010-12-24 Changed documentation section styles to be consistent (and to the sec…
103 *******************************************
6b66d155 »
2009-09-15 docs converted to sphinx
104 ::
dd110f3b »
2009-01-21 docs about the navigation
105
2b550e38 »
2009-03-30 docs
106 {{ node.is_leaf_node }}
dd110f3b »
2009-01-21 docs about the navigation
107
f6261b30 »
2009-06-21 some doc changes by adball
108 Is it the last in the tree? If true it doesn't have any children.
109 (This normally comes from mptt.)
6b66d155 »
2009-09-15 docs converted to sphinx
110 ::
dd110f3b »
2009-01-21 docs about the navigation
111
2b550e38 »
2009-03-30 docs
112 {{ node.level }}
dd110f3b »
2009-01-21 docs about the navigation
113
f6261b30 »
2009-06-21 some doc changes by adball
114 The level of the node. Starts at 0.
6b66d155 »
2009-09-15 docs converted to sphinx
115 ::
dd110f3b »
2009-01-21 docs about the navigation
116
83e76c0f »
2009-06-18 added some docs
117 {{ node.menu_level }}
0299f9df »
2010-08-01 Cleaned up 80 col wrapping in most docs, fixed *all* Sphinx build err…
118
f6261b30 »
2009-06-21 some doc changes by adball
119 The level of the node from the root node of the menu. Starts at 0.
c1fce4d6 »
2009-07-09 A few more edits to the navigation documentation.
120 If your menu starts at level 1 or you have a "soft root" (described
121 in the next section) the first node still would have 0 as its `menu_level`.
6b66d155 »
2009-09-15 docs converted to sphinx
122 ::
dd110f3b »
2009-01-21 docs about the navigation
123
2b550e38 »
2009-03-30 docs
124 {{ node.get_absolute_url }}
dd110f3b »
2009-01-21 docs about the navigation
125
c1fce4d6 »
2009-07-09 A few more edits to the navigation documentation.
126 The absolute URL of the node.
6b66d155 »
2009-09-15 docs converted to sphinx
127 ::
dd110f3b »
2009-01-21 docs about the navigation
128
2b550e38 »
2009-03-30 docs
129 {{ node.get_title }}
dd110f3b »
2009-01-21 docs about the navigation
130
f6261b30 »
2009-06-21 some doc changes by adball
131 The title in the current language of the node.
6b66d155 »
2009-09-15 docs converted to sphinx
132 ::
7247cb3a »
2009-03-30 docs added
133
2b550e38 »
2009-03-30 docs
134 {{ node.selected }}
dd110f3b »
2009-01-21 docs about the navigation
135
f6261b30 »
2009-06-21 some doc changes by adball
136 If true this node is the current one selected/active at this URL.
6b66d155 »
2009-09-15 docs converted to sphinx
137 ::
0299f9df »
2010-08-01 Cleaned up 80 col wrapping in most docs, fixed *all* Sphinx build err…
138
2b550e38 »
2009-03-30 docs
139 {{ node.ancestor }}
dd110f3b »
2009-01-21 docs about the navigation
140
141 If true this node is an ancestor of the current selected node.
6b66d155 »
2009-09-15 docs converted to sphinx
142 ::
dd110f3b »
2009-01-21 docs about the navigation
143
2b550e38 »
2009-03-30 docs
144 {{ node.sibling }}
dd110f3b »
2009-01-21 docs about the navigation
145
146 If true this node is a sibling of the current selected node.
6b66d155 »
2009-09-15 docs converted to sphinx
147 ::
dd110f3b »
2009-01-21 docs about the navigation
148
2b550e38 »
2009-03-30 docs
149 {{ node.descendant }}
dd110f3b »
2009-01-21 docs about the navigation
150
151 If true this node is a descendant of the current selected node.
6b66d155 »
2009-09-15 docs converted to sphinx
152 ::
dd110f3b »
2009-01-21 docs about the navigation
153
2b550e38 »
2009-03-30 docs
154 {{ node.soft_root }}
dd110f3b »
2009-01-21 docs about the navigation
155
c1fce4d6 »
2009-07-09 A few more edits to the navigation documentation.
156 If true this node is a "soft root".
dd110f3b »
2009-01-21 docs about the navigation
157
ebbc5661 »
2010-12-24 Changed documentation section styles to be consistent (and to the sec…
158 **********
c1fce4d6 »
2009-07-09 A few more edits to the navigation documentation.
159 Soft Roots
ebbc5661 »
2010-12-24 Changed documentation section styles to be consistent (and to the sec…
160 **********
dd110f3b »
2009-01-21 docs about the navigation
161
c1fce4d6 »
2009-07-09 A few more edits to the navigation documentation.
162 "Soft roots" are pages that start a new navigation.
163 If you are in a child of a soft root node you can only see the path to the soft root.
164 This feature is useful if you have big navigation trees with a lot of pages and don't
165 want to overwhelm the user.
dd110f3b »
2009-01-21 docs about the navigation
166
c516c1c9 »
2009-09-17 documentation is now 100% sphinx compatible
167 To enable it put the following in your ``settings.py`` file::
dd110f3b »
2009-01-21 docs about the navigation
168
c1fce4d6 »
2009-07-09 A few more edits to the navigation documentation.
169 CMS_SOFTROOT = True
dd110f3b »
2009-01-21 docs about the navigation
170
c1fce4d6 »
2009-07-09 A few more edits to the navigation documentation.
171 Now you can mark a page as "soft root" in the 'Advanced' tab of the page's settings in the admin interface.
dd110f3b »
2009-01-21 docs about the navigation
172
ebbc5661 »
2010-12-24 Changed documentation section styles to be consistent (and to the sec…
173 ******************************
25e58683 »
2010-01-01 docs updated
174 Modifying & Extending the menu
ebbc5661 »
2010-12-24 Changed documentation section styles to be consistent (and to the sec…
175 ******************************
53cf0531 »
2009-12-30 docs updated
176
177 Please refer to the app integration documentation
Something went wrong with that request. Please try again.