How to redirect a menu to his first submenu

Hello,
I come back with MODx and I have to build a web site with submenu

I created resources as the following

Menu1
– sub1-1
– sub1-2
– sub1-3
Menu2
Menu3
– sub3-1
– sub3-2
Menu4
– sub4-1
---- sub4-1-1
---- sub4-1-2
---- sub4-1-3
– sub4-2
---- sub4-2-1
---- sub4-2-2
---- sub4-2-3

On the web page, I have the main menu. With WayFinder, I show only the first level of my menu

Menu1 - Menu 2 - Menu 3 - Menu 4

Below, I will print only the subemnu from level 2 and 3 (or more)

I need, when someone click on one of the imen of the first level, he his redirected to the first submenu item.

For example

Menu 1 will redirect to Sub1-1
Menu 2 will redirect to resource Menu 2
Menu 3 will redirect sub3-1
Menu4 will not redirect sub4-1, but to sub4-1-1

I remember, we can change the type of the resource to link or symbolic link and I could add [[~12]], to redirect to page with the ID 12. But that’s does not work

Could you refresh me, how to do that?
Thanks

There is an extra FirstChildRedirect for this functionality.

2 Likes

I’ve automated this a bit in the past by setting the template up with: [[*content:default=`[[FirstChildRedirect]]`]]
That way, it it just automatically redirects to a child page if the content is empty.

Thanls @matdave, I am going to try. That’s interresting

1 Like

Dear @matdave
I try to replace

[[*content]]

by

[[*content:default=[[FirstChildRedirect]]]]

But it alway redirect to the home page

may I missed something?

Cheers