Issue
I'm using Wagtailmenus 3.0.2.
The documentation says:
If the template is for rendering the first level of a main or flat menu, then menu_items will be a list of MainMenuItem or FlatMenuItem objects (respectively). In all other cases. it will be a list Page objects.
(https://wagtailmenus.readthedocs.io/en/v3.0/rendering_menus/custom_templates.html)
I'm using a FlatMenu with only one level. I need to access Page fields but it's not rendered in the template.
When I use a multilevel menu, I can access Page fields inside the submenu without problem.
I wonder if there is a way to access Page fields inside the first level menu.
Thanks in advance for your help!
Solution
You can use item.link_page at top level of menu, for example:
{% for item in menu_items %}
... {{ item.link_page.title}} ...
Answered By - AYS
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.