# Create/Modify SiteMenu from Document

**URL:** <https://community.bloomreach.com/t/create-modify-sitemenu-from-document/4439>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [July 3, 2024, 2:23pm UTC](https://community.bloomreach.com/t/create-modify-sitemenu-from-document/4439 "2024-07-03T14:23:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doenut](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@Doenut](https://community.bloomreach.com/u/Doenut)\
**Post date:** [July 3, 2024, 2:23pm UTC](https://community.bloomreach.com/t/create-modify-sitemenu-from-document/4439/1 "2024-07-03T14:23:51Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![Nicholas\_Pavao](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/nicholas_pavao/32/1370_2.png) [@Nicholas\_Pavao](https://community.bloomreach.com/u/Nicholas_Pavao)\
**Post date:** [July 3, 2024, 2:41pm UTC](https://community.bloomreach.com/t/create-modify-sitemenu-from-document/4439/2 "2024-07-03T14:41:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Lef\_Karamoulas](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/lef_karamoulas/32/82_2.png) [@Lef\_Karamoulas](https://community.bloomreach.com/u/Lef_Karamoulas)\
**Post date:** [July 3, 2024, 2:46pm UTC](https://community.bloomreach.com/t/create-modify-sitemenu-from-document/4439/3 "2024-07-03T14:46:29Z")

</div>

In addition to Nick’s suggestion you can create a [repository based menu](https://xmdocumentation.bloomreach.com/library/concepts/hst-configuration-model/sitemenu-configuration.html#scroll_repository-based-menus) 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

---

<div class="post-metadata">

**Author:** ![Doenut](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@Doenut](https://community.bloomreach.com/u/Doenut)\
**Post date:** [July 3, 2024, 3:28pm UTC](https://community.bloomreach.com/t/create-modify-sitemenu-from-document/4439/4 "2024-07-03T15:28:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Doenut](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@Doenut](https://community.bloomreach.com/u/Doenut)\
**Post date:** [July 3, 2024, 5:14pm UTC](https://community.bloomreach.com/t/create-modify-sitemenu-from-document/4439/5 "2024-07-03T17:14:12Z")

</div>

I mean the Menu Editor in the Experience is working the same way. Where can I look how it creates a SiteMenuEntry?

> **[Manage a Navigation Menu - Bloomreach Experience Manager (PaaS/Self-Hosted) -...](https://xmdocumentation.bloomreach.com/library/end-user-manual/channel-manager/manage-navigation-menu.html)**
>
> The fast and flexible on-premise or PaaS headless CMS
