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

Forums / General Discussions / How to disable the unneccessary insertions to the markup?

How to disable the unneccessary insertions to the markup?

4 posts, 0 answered
  1. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    04 Nov 2010
    Link to this post
    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?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    04 Nov 2010
    Link to this post
    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
  3. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    05 Nov 2010
    Link to this post
    Thanks, what could be the possible approaches for this? "You have to override the RadMenu control and create a custom scripts for it."
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    05 Nov 2010
    Link to this post
    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
4 posts, 0 answered