Overriding singular navigation dropdown menu

Posted by Community Admin on 04-Aug-2018 02:37

Overriding singular navigation dropdown menu

All Replies

Posted by Community Admin on 03-Jun-2015 00:00

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.

Posted by Community Admin on 08-Jun-2015 00:00
Bump. ​Checking to see if anyone has any thoughts?
Posted by Community Admin on 10-Jun-2015 00:00
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
 
This thread is closed