How to add Custom welcome control menu item Icons SharePoint 2013?
-
09-10-2020 - |
Вопрос
Hi I have developed a custom welcome control for SharePoint 2013 website. I can see the Welcome control menu items as required but the Icons for each menu items are not visible. This is the code for each menu item.
<SharePoint:MenuItemTemplate runat="server" id="Change_custom_Password"
Text="Change Password"
Description="Change my password."
ImageUrl="/images/changepassword.png"
OnLoad="MenuItemTemplate_OnLoad"
MenuGroupId="150"
UseShortId="true"
Sequence="110"
/>
This code works fine in Sharepoint 2010 and displays the images next to the menu item but the ImageUrl property is not working in SP2013.
SP2013 looks like this:
and SP2010 looks like this:
Can anyone suggest how can I get this working in 2013?
Thank you!
Решение
I got this thing working through CSS in master page by using the ID of the menu item as follows:
div[id$="Change_custom_Password"]{
background-image:url('/SiteAssets/images/Change_custom_Password.png');
background-repeat: no-repeat;
background-position: left ;
width:100%;
height:32px;
}