I would like to create a custom component to use in Experience Builder, and this component will allow a configurable navigation to another page. I would like to use a dynamic picklist with Apex to get the list of all available pages for the Community we’re currently on.
I couldn’t find any way to get the list of these pages, is there a table that can be queried to get this list of pages/routes ?
I noticed that when editing a NavigationMenu, the list is available but from a private and undocumented API:
I couldn’t find any official API or table to get this.
The best way to tackle this would be to use the
NavigationMenu you mentioned in the builder and then query for those items in your Apex code.
Within the builder you can use a
VisualBuilder apex class (DynamicPickList Class) as a
targetConfig type to show a dropdown of available
<property name="navigationName" type="String" label="Navigation Name" datasource="apex://CommunityMenusVisualEditor" />
Then within your LWC you can query for the menu with the
navigationName (from the targetConfigs) and a similar setup to the az-insurance example app.