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

Forums / Designing with Sitefinity / Menu instead of text in SiteMenu

Menu instead of text in SiteMenu

4 posts, 0 answered
  1. noam
    noam avatar
    5 posts
    Registered:
    18 Mar 2009
    26 Mar 2009
    Link to this post
    Hi

    I'm using SiteMenu Control in the pages of my website.
    I would like that for one specific page, an image will be shown on the SiteMenu instead of a text with the page name.

    I know that RadMenu is suppose to support such a thing, but how can i do it in Sitefinity ?

    Thanks,
    Noam Bartov.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    26 Mar 2009
    Link to this post
    Hi noam,

    Check out the code below which you should add on Item_DataBound method.

        public void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e) 
        {     
            // here the item text should be the same as your image name. The format is gif 
            e.Item.ImageUrl = "~/Images/" + e.Item.Text + ".gif"
     
            // another way 
            //if (e.Item.Text == "Test") 
            // { 
            //     e.Item.ImageUrl = "~/Images/Test.gif"; 
            // } 

    I  hope this helps.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. noam
    noam avatar
    5 posts
    Registered:
    18 Mar 2009
    29 Mar 2009
    Link to this post
    thanks, it worked great.
    can you help me figure out how can i align the image ?
    now it is top-left, and i want it to be centered both horizontally and vertically.

    Noam.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    29 Mar 2009
    Link to this post
    Hi noam,

    Check out the following articles from RadMenu dev manual
    1. Setting the CSS Class of Items
    2.CSS Skin File Selectors

    I hope this helps.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Register for webinar
4 posts, 0 answered