Hey there,
lets say I have a document based menu which is rendered on my site.
For example:
Menu
Submenu → links to document
Its basically just a ordered collection of headlines and links to documents.
Is there a way to create a SiteMenu programmaticly based on these document? I mean some Utility or something that actually writes to the repository. The Experience Manger is doing the same but I couldnt find any code to have a deeper look into it.
Best regards,
If you write a custom Java component, you can define a content schema where it retrieves specific documents for the menu. The Experience Manager is a collection of Experience Pages and sitemapitems. You may also find collecting those as a valid solution.
The best solution for your project will depend on your content folder structuring and general content model.
In addition to Nick’s suggestion you can create a repository based menu if you want the menu to follow the structure of your content in the CMS. This approach can’t work if you have a single document dictating your menu structure.
Kind regards, HTH
Hello,
thanks four your suggestions. I can not use the content structure, I also thought about repository based menu’s but thats not an option. I just have title and a link to a content bean or a list of content beans, these can lay everywhere. The Document defines the structure of the menu and should be used to create a HstSiteMenu in the repository.
I mean the Menu Editor in the Experience is working the same way. Where can I look how it creates a SiteMenuEntry?