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

Forums / Developing with Sitefinity / RadMenu (sitemap) ItemTemplate

RadMenu (sitemap) ItemTemplate

3 posts, 0 answered
  1. Shawn Krivjansky
    Shawn Krivjansky avatar
    18 posts
    Registered:
    11 Jan 2010
    04 Apr 2010
    Link to this post
    I have a HTML layout for a Navigation Menu that looks like the following:

    <div id="navigation">

     

     

        <ul>

     

     

            <li class="top-nav" id="nav-1"><a href="~/Group1.aspx" class="top-link"

     

     

                title="Group1">Group1</a>

     

     

            <!-- DROP DOWN MENU -->

     

     

                <ul class="dropdown" id="dd-1">

     

     

                    <li>

     

     

                        <ul>

     

     

                            <li><a href="~/Group1/Page1.aspx">Page1</a></li>

     

     

     

                            <li><a href="~/Group1/Page2.aspx">Page3</a></li>

     

     

     

     

                            <li><a href="~/Group1/Page3.aspx">Page3</a></li>

     

     

                        </ul>

     

     

                    </li>

     

     

                </ul>

     

     

            <!-- END DROP DOWN MENU -->

     

     

            </li>

     

     

     

            <li class="top-nav" id="nav-2"><a href="~/Group2.aspx" class="top-link"

     

     

     

     

     

                title="Group2">Group2</a>

     

     

     

     

     

            <!-- DROP DOWN MENU -->

     

     

     

     

     

                <ul class="dropdown" id="dd-2">

     

     

     

     

     

                    <li>

     

     

     

     

     

                        <ul>

     

     

     

     

     

                            <li><a href="~/Group2/Page1.aspx">Page1</a></li>

     

     

     

     

     

     

                            <li><a href="~/Group2/Page2.aspx">Page3</a></li>

     

     

     

     

                            <li><a href="~/Group2/Page3.aspx">Page3</a></li>

     

     

     

     

     

     

     

     

                            <li><a href="~/Group2/Page4.aspx">Page4</a></li>

     

     

     

     

     

     

                            <li><a href="~/Group2/Page5.aspx">Page5</a></li>

     

     

     

     

                            <li><a href="~/Group2/Page6.aspx">Page6</a></li>

     

     

     

     

     

     

                        </

     

    ul>

     

     

     

     

     

                    </li>

     

     

     

     

     

                </ul>

     

     

     

     

     

            <!-- END DROP DOWN MENU -->

     

     

     

     

     

            </li>

     

            <!-- ETC... ETC... ETC... -->

     

     

     

     

        </

     

    ul>

     

     

    </div>

     


    I need this type of layout tied into the RadMenu and CMS Sitemap for dynamic page additions.  I understand that I probably need to at least override the current "Site Menu" control in Sitefinity.  So, assuming that I have a copy of the current SiteMenu control and am creating my own usercontrol for this, is there ANY way to accomplish the above layout without completely constructing the entire thing in code (behind) ??

    I was hoping to take advantage of the RadMenu ItemTemplate, but not sure I can given this layout.  I might be able to concede certain parts of the layout above if it would mean making the ItemTemplate work nice and easy with the above.  One of the issues I am having is that the CSS tied into the layout above is using background images for the menu not real IMAGES that can be set from ImageUrl of RadMenuItem and so forth.

    Anyway I can use ItemTemplate for this?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    04 Apr 2010
    Link to this post
    Hello Shawn Krivjansky,

    Create a RadMenu control that is bound to SiteMapDataSource control. (RadMenuData binding). You could set the image of each item if you subscrine for ItemDataBound event of the RadMenu. There you could access each RadMenuItem and set ImageUrl.

    Best wishes,
    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. Shawn Krivjansky
    Shawn Krivjansky avatar
    18 posts
    Registered:
    11 Jan 2010
    04 Apr 2010
    Link to this post
    As explained, I cannot use the ImageURL property because the menu does not reference any "real" hard images (see the layout... no IMG tags).  All the images used are background images that come from the CSS.  The CSS is entirely fixed into the given html layout (elements, IDs, classes etc).  To further complicate things, the background images that are used are built with Sprites.  So, it isn't easy to completely change the given layout.

    This is why I was wondering if I could use the ItemTemplate in some way to somehow use the exact template that I have, so I wouldn't need to rethink of how to duplicate the layout in a different way or build it entirely in code.

    Most (good) navigation menus today that come from designers are CSS based in this similar way.  I was thinking there would be an easier way to take that somewhat standard type of layout and get the RadMenu to build according to my template.

    Am I wrong?
Register for webinar
3 posts, 0 answered