function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shanker NemaniShanker Nemani 

How can I build a sitemap dynamically?

How can I build a sitemap dynamically?

Is there any way we can do that. I have gone through the material which is a manual way.

sfdcfoxsfdcfox

The only way ou could build a site map would be to build a site metadata infrastructure, which is not impossible, but will require some planning to be successful. There is no "default" method for creating a sitemap, nor is there really a strong infrastructure for creating this data fro scratch through metadata that is already available. However, you can use components (apex:component) and page includes (apex:include) to create a system where the page can run off of a template-style system. For example, if you created a custom object called MenuItem, which would have a Name, an Order ID (for sorting), and a ParentMenuItem (lookup to another menu item), then created a component to render these items, you can create an infinitely recursive menu. Then, you would have your main page display this menu and use an apex:include to call up an inner page depending on the page parameters. With a little effort, you could create a semi-dynamic menu (it would ultimately be configured through a custom object instead of Visualforce or Apex Code).