none
Programmatically change subsite logo RRS feed

  • Question

  • Hi,

    Time for next question :)

    In template site i have a logo, but when i create the site from the template the logo is missing.

    Tried to bind the correct logo with

    web.SiteLogoUrl = "/_layouts/images/logo.jpg"

    but failed for some reason.. no errormessage.

    I just need to change logopicture for a subsite (http://server/projects/13-0001 - where 13-0001 is the subsite)

    Anyone got any idea?

    Sunday, March 3, 2013 10:13 AM

Answers

  • Hi again,

    Damn i noticed that i missed to use web.update() after setting SiteLogoUrl.

    Now its working :)

    Thanks anyway!

    Sunday, March 3, 2013 5:05 PM

All replies


  • Use the ULS log to troubleshoot the operation and set it to verbose for better understanding.

    Also try with this PowerShell script

    Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
     
    $siteUrl = "http://<site collection url>"
     
    $siteLogo = "/SiteAssets/YourLogo.png"
    $rootSite = Get-SPSite $siteUrl
    $allWebs = $rootSite.AllWebs
     
    foreach ($web in $allWebs) {
      Write-Host "Updating " + $web.Url
      $web.SiteLogoUrl = $siteLogo
      $web.Update()
    }


    Marco Rizzi @Avanade Italy http://blog.marcorizzi.com


    • Edited by Marco Rizzi Sunday, March 3, 2013 10:30 AM
    • Proposed as answer by Marco Rizzi Sunday, March 3, 2013 5:27 PM
    Sunday, March 3, 2013 10:29 AM
  • Hi again,

    Damn i noticed that i missed to use web.update() after setting SiteLogoUrl.

    Now its working :)

    Thanks anyway!

    Sunday, March 3, 2013 5:05 PM