How to disable the unneccessary insertions to the markup?

Posted by Community Admin on 03-Aug-2018 03:07

How to disable the unneccessary insertions to the markup?

All Replies

Posted by Community Admin on 04-Nov-2010 00:00

Hello Telerik team!

I am specifically talking about the navigation control. Prior to Sitefinity, we have successfully deployed in our site a very basic navigation menu that basically lists down all items under a category on one portion of the page, just like this:

Item1
Item2
Item3

So of course, the markup of that would be as simple as links wrapped in ul li's then wrapped further with a div right? However, when I tried to apply Sitefinity, using the Navigation control, it inserted so many unnecessary tags to the markup like excessive divs and the like. Kindly see screenshot. Furthermore, these extra tags also gave way for the overriding of our CSS styles and insertion of unneeded scripts. I tried to set certain attributes to false like "EnableTheming" but to no avail. How do I go with this?

Posted by Community Admin on 04-Nov-2010 00:00

Hi jkregala,

You cannot change the way that RadMenu generates its items and the html of them. You have to override the RadMenu control and create a custom scripts for it.
When you use ItemTemplate the control generates <div>tags - <li> <div class="rmText"> </>

All the best,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 05-Nov-2010 00:00

Thanks, what could be the possible approaches for this? "You have to override the RadMenu control and create a custom scripts for it."

Posted by Community Admin on 05-Nov-2010 00:00

Hello jkregala,

You can disable the embedded java script resources of the control. Then you can download a trial of Telerik RadControls for ASP.NET AJAX from where you can download RadMenuScripts.js and you should modify the _render function

_render: function(html)
    
        var renderSlide = this.get_parent().get_items().get_count() == 1;
 
        html[html.length] = "<li class='" + this._determineCssClass() + "'>";
        this._renderLink(html);
 
        if (this.get_imageUrl())
            this._renderImage(html);
 
        html[html.length] = "<span class='rmText'>";
        html[html.length] = this.get_text();
        html[html.length] = "</span></a>";
 
        this._renderChildItems(html);
 
        html[html.length] = "</li>";
    ,


All the best,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed