3

I have modified the navigation items by adding heading and link using Structural Navigation editing and sorting.

While adding the heading(MY WORKSPACE), i have given the URL as empty but while clicking the heading redirection to another link takes place.

enter image description here

How to Prevent this?

6
  • This is working as expected, on heading by keeping it empty it does not form hyperlink and it is not clickable. Tried in 2010 and 2013. which version you are using, and where it is redirecting ? Commented Nov 14, 2016 at 10:26
  • I am using 2013 and it redirects to same site collection(reloading takes place). I have given URL empty but it shows site collection URL. I have tried by deleting another time and saved it but same site collection URL remains.
    – Kumaraguru
    Commented Nov 14, 2016 at 10:33
  • it is strange...are you using any custom css or js file ? because in 2013 is not not clickable... Commented Nov 14, 2016 at 11:04
  • Can you please check if there is space in your field URL ? Commented Nov 14, 2016 at 11:07
  • Yeah!! I am using custom master page and that includes custom CSS and Scripts
    – Kumaraguru
    Commented Nov 14, 2016 at 11:07

1 Answer 1

3

By providing the URL as empty it takes the welcome page URL by default.It is possible to provide URL as '/javascript:return true;' but still the page will reload.Finally I found the solution by removing the attribute 'href' of heading using jquery.

Code:

     var elements = document.querySelectorAll('ul[id^=zz][id$=_RootAspMenu] > li > a');
     for (var i = 0; i < elements.length; i++) {
       $(elements[i]).removeAttr('href');
     }

Your Answer

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

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