/
navigation_recurse.pt
42 lines (37 loc) · 2.1 KB
/
navigation_recurse.pt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<tal:master define="level options/level|python:0;
children options/children | nothing;
bottomLevel options/bottomLevel | nothing;"
i18n:domain="plone">
<metal:main define-macro="nav_main">
<tal:navitem repeat="node children">
<li tal:define="show_children node/show_children;
children node/children;
item_url node/getURL;
item_icon nocall:node/item_icon;
item_type node/portal_type;
is_current node/currentItem;
is_in_path node/currentParent;
li_class python:is_current and ' navTreeCurrentNode' or '';
li_extr_class python:is_in_path and ' navTreeItemInPath' or '';
li_folder_class python:show_children and ' navTreeFolderish' or '';
normalizeString nocall: context/plone_utils/normalizeString;"
tal:attributes="class string:navTreeItem visualNoMarker${li_class}${li_extr_class}${li_folder_class} section-${node/normalized_id}"
tal:condition="python:bottomLevel <= 0 or level <= bottomLevel">
<tal:level define="item_class string:state-${node/normalized_review_state};
item_type_class python:'contenttype-' + normalizeString(item_type);
item_class python:is_current and item_class + ' navTreeCurrentItem' or item_class;">
<a tal:attributes="href python:item_url;
title node/Description;
class string:$item_class${li_class}${li_extr_class}${li_folder_class} $item_type_class">
<img tal:replace="structure item_icon/html_tag" />
<span tal:content="node/Title">Selected Item Title</span>
</a>
<ul tal:attributes="class python:'navTree navTreeLevel'+str(level)"
tal:condition="python: len(children) > 0 and show_children">
<span tal:replace="structure python:view.recurse(children=children, level=level+1, bottomLevel=bottomLevel)" />
</ul>
</tal:level>
</li>
</tal:navitem>
</metal:main>
</tal:master>