Hi! I’m working on a simple website, it has some pages, in a couple of 2-levels menu, let’s say:
A
AA
AB
AC
B
BA
BB
BC
What i’d like is that when i click on A i view directly the AA page, and when i click on B i want to see BB, so when clicking on a menu item with childs, i’d like to go to the first child page.
Is there a way to do so?
A related question is: is there a way to insert a custom menu item with a custom url and a custom controller in code, just to handle this or other situations where the simple folder->file structure is not enough?
I saw this topic, but if possible i’d like to have the first level clickable…
Basically i added that {% set child … %} and replaced p.url with child.url in the src.
My question remains thou, at least partially.
From what i can understand the menu is built differently from theme to theme, so there’s no a common way to do something to it.
But besides the way it’s created, is there a way to tell that at a certain route / url the response have to be given from a custom controller? (let’s say that for a single page i need to do some PHP work with some service call or something like that, or create a custom redirect to other pages of the site with certain conditions…
In general, it is not that handy to ask two distinct questions in one post. Would you mind splitting the post into two separate questions each with a proper title?
Since you have already answered your first question (kudos) , you may mark this thread as being ‘solved’ by clicking the ‘solution’ icon in your own reply.