Does anyone know if the SXA navigation component can be made to render links that are not links to pages in the Sitecore site itself? In other words, any kind of external link, or otherwise show links to items within Sitecore in a way that deviates from the hierarchy of the tree it is crawling. Thanks
You can do this with few tweaks.
When you create a site with all modules (features) enabled you can add
Redirect items under Home.
Redirect items can already point to any item or external page, our goal is to make them visible in navigation.
One and the only requirement for that is to add
_Navigable to base templates, so.
- Got to your project tenant templates (
- Add new template
- Add following base templates:
- Create item using new template.
Redirection URLfield and
Link Caption in Navigation(remember that your navigation should respect this field in rendering variant)
This is not the perfect solution due to additional redirect, but it works! I used this approach in the past and it worked fine. Actually, I can see advantages of this approach. You are able to track external links clicks or do anything you want. Always see the bright side ;)