Sharepoint solution packaging: how do I get a custom icon for my features?
Asked Answered
A

3

6

I am not sure how foolish I am being here!

I have a solution that packages up some master pages and layouts etc which I can deploy fine and the feature appears in the "Site Collection Features" list fine. However I would like to put a custom icon next to my feature. I would like the icon to be in the solution package and so require the image to be put in a list or folder when the solution is deployed (rather than a feature activated).

Is this possible? simple?

There is something about all this sharepoint solution/feature.xml/element.xml I don't grok yet!

Anthia answered 1/4, 2009 at 10:13 Comment(0)
S
11

It is possible and simple.

  1. In your Feature.xml file, simply include the ImageUrl="" attribute and specify the location of your image. The best practice is to create a folder under the Template\Images folder with your images and then reference this location
  2. Include the folder which contains your images in the solution ddf file
  3. Once deployed, you should have a %12HIVE%\Templates\Images\ACMEImages folder which contains your image

Feature.xml sample:

<Feature 
    Id="21F724AE-9C1C-4F4D-AAE9-7789CA01A7E3"
    Title="ACME Lists"
    Description="List definitions for the ACME"  
    Version="1.0.0.0"
    Hidden="false"
    Scope="Web"
    ImageUrl="ACMEImages\acmelogo.png"
    xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- other feature file info omitted -->

DDF file sample:

.Set DestinationDir=IMAGES\AcmeImagesRootFiles\TEMPLATE\IMAGES\ACMEIMages\acmelogo.png
Superintend answered 1/4, 2009 at 12:52 Comment(1)
Great answer. Any idea what the size specifications for this image are?Agger
C
8

In SharePoint 2010, the Microsoft Default icon is: GenericFeature.gif - a 31 x 22 image. With VS 2010 and SP 2010, you can add a SharePoint "Images" mapped folder to your SharePoint project. Then place your image in this folder. Be sure to provide the Image URL in the Properties panel of the *.feature object. Use a path to the image as noted above.

Corrinacorrine answered 2/6, 2010 at 20:25 Comment(1)
The default icon is the same in SharePoint 2007: a 31x22 px .gifGuanabana
R
0

Pete's solution didn't work for me although I did exactly as he suggests. My problem is that SharePoint is looking for the image in the /_Layouts folder rather than the Templates/Images folder.

Rase answered 12/10, 2011 at 21:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.