Hi,
I’m trying to use the anvil-extras Navigation together with the Hash Routing navigation method.
I use the Navigation module for generating the menus dinamically, and I want to display the Form titles using its functionallity, in order to display a different title for each form in the Title slot of the template form (the one that holds the menu).
Here is what I’ve done:
I started with the Hash Routing only. Everything worked ok.
Then, I introduced the Navigation module, and made the required changes.
At this point I’m not sure which module is in fact taking care of the navigation, because I commented the nav_click event, so the Hash Routing is not being called directly anymore. However the navigation is happening. So, that makes me think the Navigation module is taking the task. But the Navigation module still needs the @routing.route from the Hash Navigation, to be present. Otherwise it does not work.
So, I’m confused about how this is working at all, because per documentation:
In order for a form to act as a target of a menu link, it has to register a name with the navigation module using a decorator on its class definition.
For example:
@navigation.register(name=“about”, title=“About”)
And I’m not using @navigation.register anywhere.
I tried using it, because I wanted to display the Title, but it completely ignores it.
So, I’m clearly missing something here. What could that be?
In summary, how is this navigating to the target forms if I haven’t registered them with the Navigation module?, and why when I use the @navigation.register, it ignores it and so the title functionallity?
Here is the sample app.
You will see the menu items defined in the visual designer, which are the ones I used for working directly with the Hash Routing + nav_click event.
And also the dinamically generated links using the Navigation menu, which are the ones that are working now.
Thank you !!!