Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 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; 
}
share|improve this answer
    
Thanks. Ideally I'd like to just know the logo path for the site, rather than needing to change it. –  Herschel Jul 3 '12 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. –  Vardhaman Deshpande Jul 3 '12 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 '12 at 9:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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