1

I am working on the navigation control and I am using horizontal version with sub-items. If a page has sub-item, I was it to redirect to dummy fragment.

For example, href="#dummy"

I am trying to use custom Redirect template that inherits _Navigable. Redirect appears in the Navigation but no matter what redirect I set, I am not able to redirect it to "#dummy".

Any idea on how it can be achieved?

This is how my front end looks

enter image description here

This is content tree

enter image description here

1
  • 1
    Have you considered using Scriban template for the rendering variant? Perhaps you'll have more control. Aug 21, 2022 at 17:36

2 Answers 2

1

I think optimally, you should be creating a rendering variant for the Navigation component with Scriban. That may help you build for your requirement. Otherwise, you can clone the Navigation component and modify the View file for the component as per your requirement.

0

Create a Custom template which inherits Redirect and _Navigable

enter image description here

Now you item will have the Redirection URL which you can point to dummy URL and will also be listed in the navigation. You can also add sub items underneath it.

enter image description here

Hope this helps.

1
  • Thanks, but it will redirect to item mentioned, I want it to stay on the same page without making round trip with the server
    – Imad
    Aug 29, 2022 at 10:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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