Technical mailing list archives

technical@mail.odoo.com

Avatar

Re: Odoo website submenu third level or even fourth level

by
Menara Services, Othmane Ghandi
- 02/01/2018 09:10:45
​I have already been there: (But what should I Add ?)

<template id="submenu" name="Submenu">
<li t-if="not submenu.child_id" t-att-class="
'active' if submenu.url and submenu.url != '/' and request.httprequest.path == submenu.url.replace('/page/website.', '/page/') else None
">
<a t-att-href="(website.menu_id.child_id[0] == submenu) and '/' or submenu.url" t-ignore="true" t-att-target="'_blank' if submenu.new_window else None">
<span t-field="submenu.name"/>
</a>
</li>
<li t-if="submenu.child_id" t-attf-class="dropdown #{
(submenu.url and submenu.url != '/' and any([request.httprequest.path == child.url.replace('/page/website.', '/page/') for child in submenu.child_id if child.url]) or
(submenu.url and request.httprequest.path == submenu.url.replace('/page/website.', '/page/'))) and 'active'
}">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<span t-field="submenu.name"/> <span class="caret" t-ignore="true"></span>
</a>
<ul class="dropdown-menu" role="menu">
<t t-foreach="submenu.child_id" t-as="submenu">
<t t-call="website.submenu"/> => Something to add here I think
</t>
</ul>
</li>
</template>

Reference