link to next page in site menu

hi! is there a way to use the onClick() function to link an object to the next page in my Site Menu?
right now I am making these links manually but I change my site structure quite often so a solution for this would be very practical.

You can try getSiteStructure() . I tried it out and it seems as if the pages are in order, but I’m not sure if that’s “guaranteed”. Also, pages that are not in the menu also appear in the list.

Another option would be to maintain a list of pages to use for the “next page” link.