1

We currently have Web 8.5 and DXA 1.7. Our _Navigation Page is created using Structure Groups and Pages. We can add a Redirect Page to add Links to the navigation which then take the web visitor deeper in to the website. The problem with this it is causing redirect chaining as below for example;

mywebsite.com/support/services 301s to mywebsite.com/support/complete-analysis-solutions

What I would like to achieve is the final destination URL to be displayed in the navigation menu.

The Redirect Page looks like the image below Redirect Page Example What I was thinking is to resolve the internalLink Component "Complete analysis solutions", like the Linker Resolver TBB does for Component Links in Rich Text Areas, and then add that final destination URL to the Navigation JSON output.

Any ideas how this can be achieved?

1 Answer 1

1

You can create your own navigation component template with an include page and have it included in your page template with your own custom module and controller.

In your entity view, you can add to or replace the linkUrl with your redirect pages, based on the inputs from your include page which should now be available in the default model.

You may also want to look at the following implementation.

For better scaling, you can override the GenerateStructureGroupNavigation in your custom implementation to check your SG custom metadata first; before including the item in the package.

1
  • Note that the OOTB DXA 1.7 TBB to generate the Sitemap / Navigation Model can be found here. You can use this as a starting point for your custom implementation. Alternative (nicer) would be to create a custom subclass and override some methods, but unfortunately the OOTB GenerateSitemap TBB contains many private methods which cannot be overridden. Mar 28, 2019 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.