Compare commits
2 commits
99eb7c39fe
...
a7abe02784
Author | SHA1 | Date | |
---|---|---|---|
|
a7abe02784 | ||
|
454767b551 |
1 changed files with 6 additions and 1 deletions
|
@ -77,12 +77,12 @@ def menuitems_children(parent, context=None):
|
||||||
menuitems_children = parent.get_children().live().in_menu().specific()
|
menuitems_children = parent.get_children().live().in_menu().specific()
|
||||||
items_to_remove = []
|
items_to_remove = []
|
||||||
for menuitem in menuitems_children:
|
for menuitem in menuitems_children:
|
||||||
|
print('type => %s' % type(menuitem))
|
||||||
try:
|
try:
|
||||||
if 'devenez' in menuitem.title.lower() and remove_devenez:
|
if 'devenez' in menuitem.title.lower() and remove_devenez:
|
||||||
items_to_remove.append(menuitem)
|
items_to_remove.append(menuitem)
|
||||||
elif 'mitglied werden' in menuitem.title.lower() and remove_mitglied:
|
elif 'mitglied werden' in menuitem.title.lower() and remove_mitglied:
|
||||||
items_to_remove.append(menuitem)
|
items_to_remove.append(menuitem)
|
||||||
menuitem.title = menuitem.trans_title
|
|
||||||
except AttributeError as ae:
|
except AttributeError as ae:
|
||||||
print("Menuitem %s has an issue :: %s" % (menuitem.title, str(ae)))
|
print("Menuitem %s has an issue :: %s" % (menuitem.title, str(ae)))
|
||||||
pass
|
pass
|
||||||
|
@ -100,6 +100,11 @@ def menuitems_children(parent, context=None):
|
||||||
menuitems_children.append(custom_page)
|
menuitems_children.append(custom_page)
|
||||||
page_ids = [page.id for page in menuitems_children]
|
page_ids = [page.id for page in menuitems_children]
|
||||||
menuitems_children = Page.objects.filter(id__in=page_ids).specific()
|
menuitems_children = Page.objects.filter(id__in=page_ids).specific()
|
||||||
|
for menuitem in menuitems_children:
|
||||||
|
try:
|
||||||
|
menuitem.title = menuitem.trans_title
|
||||||
|
except AttributeError as aee:
|
||||||
|
pass
|
||||||
return menuitems_children
|
return menuitems_children
|
||||||
|
|
||||||
# Retrieves the children of the top menu items for the drop downs
|
# Retrieves the children of the top menu items for the drop downs
|
||||||
|
|
Loading…
Reference in a new issue