Technical mailing list archives


Re: Odoo website submenu third level or even fourth level

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=""/>
<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=""/> <span class="caret" t-ignore="true"></span>
<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