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 was hoping someone may be able to guide me in the right direction. I want the header in a custom master page to have a background image that can be changed by an 'owner' in a user friendly manner.

The image(s) will be stored in a picture library on the root site and the master page is applied to all sites and sub-sites.

I had an idea whilst writing this post of using the logo URL option in the settings of the site.

Does anyone have any suggestions as to how I can achieve this?

Thanks in advance,
James

share|improve this question
    
Thanks for the suggestions so far. Both idea's are great but are require a user editing a CSS file to apply a different banner. I was hoping to find a more user friendly or content manageable solution like the logo URL option in the settings of the site. –  James Callaghan Jun 27 '12 at 15:30
    
Perhaps a custom solution that will manage a setting value and store it in the site property bag that I access within the master page like the site name etc. –  James Callaghan Jun 27 '12 at 15:31
    
James, the solution I provided does not involve the user to modify anything in the css. Its a onetime filename entry by the designer and every subsequent updates can be made the owner. It means owner can upload the banner on the picture library and it appears on the masterpage automatically without any involvement of the designer or the owner to modify any css file. All it requires is the filename of the banner should be same as defined in the css style. –  Arko D Jun 28 '12 at 10:53
add comment

3 Answers

I think this may be a good question. I've personally used the CSS method, similar to the other answers. You could do the Logo, like you wanted, from the site settings, but that creates an image tag as opposed to a background image. So the problem becomes how to change it from being an image into being a background. One thing you could try, then, is javascript. Use the javascript to get the "src" attribute from the logo image and then apply the image location to the "background-image" property of the header element. That is the least customization I can think of that still lets you set the background from the site settings.

  • Matt
share|improve this answer
add comment

You can probably use an alternate stylesheet with a class that calls the image from the picture library relative to its css file location. Best option would be to create a branding structure like this :-

/
/Style Library > YourProjectName > YourCssfile.css 
/Picture Library > OwnerUploadedImage.jpg

In your masterpage use the class on the td or div where you want to the background image to appear. On your css create the class with a style like background-image:url('../Picture Library/banner.jpg')

Ofcourse this will work once you have included the correct references to this stylesheet in the masterpage. From here on whenever an image with the same name and file extension is uploaded in the picture library by the owner it will appear in the masterpage. Only drawback is the solution is filename specific and you gotta hardcode your imagename in the css class.

share|improve this answer
add comment

Try this from this forum. http://social.technet.microsoft.com/Forums/en-US/sharepoint2010customization/thread/929c9fe6-a222-43a9-9551-985c0f20756d/

BODY
{
background-color:#F4F2E5;
background-image:url('../Style Library/Images/B360 Large.png')
}

OR

.s4-workspace
{
background-color:#F4F2E5;
background-image:url('../Style Library/Images/B360 Large.png')
}
share|improve this answer
add comment

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.