trans_title optional

This commit is contained in:
Oleg Lavrovsky 2017-07-03 17:47:56 +02:00
parent 4869a79b43
commit dd52f23d54

View file

@ -39,6 +39,7 @@ def top_menu(context, parent, calling_page=None):
menuitem.show_dropdown = has_menu_children(menuitem)
menuitem.active = (calling_page.url.startswith(menuitem.url)
if calling_page else False)
if 'trans_title' in menuitem:
menuitem.title = menuitem.trans_title
return {
'calling_page': calling_page,
@ -49,6 +50,7 @@ def top_menu(context, parent, calling_page=None):
def menuitems_children(parent):
menuitems_children = parent.get_children().live().in_menu().specific()
for menuitem in menuitems_children:
if 'trans_title' in menuitem:
menuitem.title = menuitem.trans_title
return menuitems_children