Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Eliana 3 posts 74 karma points
    Jun 10, 2016 @ 09:38
    Eliana
    0

    Anchor links not working

    Hello I'm new in Umbraco and just setup a site. I have created a navigation menu using macro partial view. Everything working fine but the links: all the links in the website, navigation links or links inserted in the pages using the editor, are not working if you click on them; if you right click on them and choose 'open in a new window' they work just fine. Any help? Thanks

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 10, 2016 @ 11:25
    Jan Skovgaard
    0

    Hi Eliana and welcome to the Umbraco developer forum also known as "Our" in daily speech :)

    What does the code you're using for rendering the navigation look like? If you want links to be opened in a new window when clicked you'll need to add the target attribute with a value of "_blank" in them like

    <a href="#" target="_blank">Link</a>
    

    But for a navigational purpose that does not seem user friendly to me? If it's a link for an external resource then I think it makes sense :)

    Looking forward to hearing from you.

    /Jan

  • Eliana 3 posts 74 karma points
    Jun 10, 2016 @ 14:51
    Eliana
    1

    Hello Jan and thanks for your reply Maybe my explanation wasn't clear :) The navigation menu renders without any problem .. the html is perfect and so are the pages The problem is when I click on any links (link pointing to pages or mailto links) they don't work .. nothing happens. If I right click on the link and choose open in a new windows the link works ... Seems like the click event on the link is not firing .. I don't get any errors but nothing happens

    Hope this is clear

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 10, 2016 @ 18:15
    Jan Skovgaard
    1

    Hi Eliana

    Ok, that makes things a bit more clear - But weird issue indeed. I'm just wondering whether there is a click event placed in some javascript somewhere, which is set to prevent the default action on links which are not part of the navigation but comes from rich text or something like that maybe?

    Do the links work if you disable javascript in the browser - If so then my theory is right :)

    Cheers, Jan

  • Eliana 3 posts 74 karma points
    Jun 13, 2016 @ 10:20
    Eliana
    0

    Hi Jan you are right .. there is a javascript file breaking the hyperlink! Thanks for the tip!

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 13, 2016 @ 11:00
    Jan Skovgaard
    0

    Hi Eliana

    Happy I could help you get on the right track :-) It's easy to get confused about these things from time to time,

    Happy coding!

    /Jan

  • Aluma 13 posts 107 karma points
    Aug 12, 2017 @ 19:19
    Aluma
    0

    I was having the exact same problem, but it is now resolved.

    My nav panel links were not working because I had created a link decorator function with e.preventDefault() very early on in the project that I forgot to remove. Of course, neither the console nor anything else indicated any errors! I removed e.preventDefault() and links began working as they should! Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft