DISQUS

DISQUS Hello!  The comments on this profile are unclaimed and thus are unverified.

Do they belong to you? Claim these comments.

Kristof's picture

Unregistered

Feeds

aliases

  • Kristof

Kristof

8 months ago

in Deploying the Master Page (Master Pages and SharePoint part 4 of 6) on SharePoint Magazine
How can i add extra pictures to a custom masterpage?
Do they need to be put in elements and feature xml file?
1 reply
ggalipeau Hi Kristof,
There are two ways to do this. The easiest way is to add the image to a folder in the 12 hive under the Layouts directory. At that point you can reference the image in the Master Page with _layouts/{folder name}/{file name}.
The other way is to put it in an image list on the root site of your page. Then you can reference them in an image tag like so: <img runat="server" src="<% $SPUrl:~SiteCollection/Style Library/Imagename.jpg%>" />
The advantage of putting them in a list is that you can manage the image in the SharePoint list moving forward. The advantage of putting them in the 12 hive layouts folder is that it is real easy and that is the way SharePoint does it with the default images.

To incorporate the layouts approach, you just need to make sure the image gets moved to the 12 hive layouts folder. You can either manually move it there, or you can have a solution do the move for you. We will talk more about this in the last article in this series.

If you do the image list approach, you can either just put the image in the correct list. Or, if you want everything to be done automatic, then you could create the list as a featre and add the image when the feature is being created. However, that is a complete other subject (i.e.: creating lists and list instances as features).
Returning? Login