3

I can get the name, url and description of a site using SP.Web but there is no logo property.

Is there a javascript COM equivalent to http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.sitelogourl.aspx?

2 Answers 2

2

It looks like Microsoft have introduced the SiteLogoUrl property now within SPWeb in Office 365:

http://blogs.office.com/2014/08/13/uservoice-driving-improvements-sharepoint-api/ and https://officespdev.uservoice.com/forums/224641-general/suggestions/6234945-make-the-sitelogourl-property-available-in-csom

The <SiteLogoUrl> element is emitted from the _api/web REST service.

1
1

I believe there is no direct way to change the Site Logo from the Client Object Model.

However, you can change it through CSS by utilizing the s4-titlelogo class:

Paste the following code in your CSS file:

.s4-titlelogo{ 
background-image: url(/path/to/yourimage.png); 
background-position:left center; 
background-repeat: no-repeat; 
} 
.s4-titlelogo > a > img{ 
visibility: hidden; 
}
3
  • Thanks. Ideally I'd like to just know the logo path for the site, rather than needing to change it.
    – Herschel
    Jul 3, 2012 at 16:57
  • Ok. Then you can easily pickup the path with JavaScript/jQuery. You just need to look into the <td> with the class .s4-titlelogo and then fetch the <a> tag inside it and then the <img> tag inside the <a> tag. The src of the <img> will be your logo path. Jul 3, 2012 at 20:25
  • I should have stated my scenario more clearly. I'm building something like the first example in weblogs.asp.net/bsimser/archive/2012/02/28/…, looping through web.getSubwebsForCurrentUser and displaying each site's name, description and link, but would also like to show its sitelogo. Looks like making a web control server-side is probably the way to go.
    – Herschel
    Jul 4, 2012 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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