5

I wanted to change the icon in site content for a custom list in SharePoint Online. Setting the ImageUrl property of the list did the job. But then I discovered that this had also changed the icon for the list when adding web parts, distorting this view:

enter image description here

Strangely setting ImageUrl has changed two icons that need to be of different size and color. I can see on other lists that SharePoint is using two different images for this by default.

How do I properly change the list icons? Can this even be done with CSOM/JSOM? (If not, can I set the list icons back to the defaults, reverting my changes?)

1 Answer 1

1

Dan, you can do the trick using CSS..

In this example i changed the default icon for the selection icon in connected web parts..

IMG[src*='/_layouts/images/rbsel.gif']
{
BACKGROUND-IMAGE: url('../../images/rbsel2.jpg'); /* This is the url for the image to replace the selected arrow*/
WIDTH: 16px; /*this must equal the width of your new image*/
HEIGHT: 0px;
PADDING-BOTTOM: 0px;
PADDING-LEFT: 0px;
PADDING-RIGHT: 0px;
PADDING-TOP: 16px ;
}

You can force a new img, width and height using CSS selectors..

PS, got this in some forum, but was long time ago and i didn't remeber the original URL, but the idea wasn't mime so i have to give the credit for the idea to someone else that i don't know who ..

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.