When working with with SXA inside of a multi-tenant solution, we are building a component to generate an HTML sitemap.
We have implemented a recursive function to generate the html sitemap dynamically based on the content tree structure. We have created a class called SitemapNode (which is basically a linked list) that is populated recursively within our controller.
We are able to see the rendered sitemap when navigating to the page in preview mode or otherwise.
However, when opening the same page in Experience Editor, the rendering does not appear. The rendering shows in the presentation details but the html is not there when I 'inspect element' in the browser dev tools.
When clicking "Add" on the placeholder we can also add the rendering, but again nothing is shown in Experience Editor. This message can be seen in the browser console trying to add the same rendering through the Experience Editor.
We are using GlassMapper -
SitecoreContext.GetHomeItem<IGlassBase>() to get the top node and it appears to be returning sitecore/content/home item.
Does anyone know the proper way to get the context of home item within a tenant using SXA?
The item we wanted is under /sitecore/content/TenantName/Sitename/Home. Was able to use the correct syntax of:
MultisiteContext.GetSiteItem(Sitecore.Context.Item); to get the correct item.