Can I get all existing Pages for a Community using Apex?

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.

enter image description here


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 NavigationMenus.

  label="Navigation Name"

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.

Ref: Set Up a Navigation Menu Using Apex

Source : Link , Question Author : Fabien Taillon , Answer Author : lu_ke____

Leave a Comment