+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Overriding singular navigation dropdown menu

Overriding singular navigation dropdown menu

3 posts, 0 answered
  1. Vincent
    Vincent avatar
    4 posts
    Registered:
    02 Jun 2015
    03 Jun 2015
    Link to this post

    I have a horizontal navigation with dropdown menus currently for my Sitefinity website.

    I'm wanting to keep everything working exactly the same except for the first menu item. I'd like to replace the contents of the first dropdown menu with some HTML, as seen in the attached image.

    I've been trying out creating a new navigation template but can't manage to target just the first menu item.

  2. Vincent
    Vincent avatar
    4 posts
    Registered:
    02 Jun 2015
    08 Jun 2015
    Link to this post
    Bump. ​Checking to see if anyone has any thoughts?
  3. Velizar Bishurov
    Velizar Bishurov avatar
    143 posts
    Registered:
    09 Dec 2016
    10 Jun 2015
    Link to this post
    Hello Vincent,

    It is possible to change the html of only the first item in the menu through JavaScript. 

    Example with jQuery: 

    var element = $("li.k-item.k-first> a");
    var currentHtml = element.html();
    element.html(currentHtml + "Hello World");

    Example with native JavaScript:

    document.querySelector("li.k-item.k-first> a").innerHTML += "Hello World";

    With both approaches there is a way to inject html from a file.

    I hope the above information helps.

    Regards,
    Velizar Bishurov
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
3 posts, 0 answered