List Type Icons for Custom List Definitions

In SharePoint, different types of list can have different icons:

That’s fine, but SharePoint 2010 adds a second icon – one that’s used in the Silverlight control for creating new Sites/Lists:

I wanted to specify that for a list definition I was upgrading from a 2007 version. But there doesn’t seem to be a property to set the name/url for this file.

In SharePoint 2007 the icons were usually .GIF files. In SharePoint 2010, those still seem to be in the IMAGES folder in 14-Hive, but there are .PNGs of the same images too. There are also the larger PNGs used by the SilverLight control. The small sized ones all seem to be called ‘ITxxx.PNG’, and the larger ‘LTxxx.PNG’:

So, I tried changing the Image property of my list definition to use a file with a .png extension (e.g. ITandy.png )

I converted my GIF to PNG format, and I created a 64×64 pixel PNG for the SilverLight control. I called this new PNG file LTandy.png – and low, the SilverLight control picked it up. It seems that the Silverlight dialog replaces the IT at the start of the image file name with an LT when looking for an icon – but only for lists where the smaller icon also has the .png extention.

Therefore, I’d recommend always using PNGs for icons in SharePoint now.

Advertisement
List Type Icons for Custom List Definitions

Control the Content Types in the New menu via code

We’ve got a project with an interesting requirement for a Document Library. When the site it provisioned, it will have a number of documents already in it, of a specific content type. Users should not be able to create more documents of that content type. Further, we would be uploading documents via some custom screens which should also be stored as ‘hidden’ document content types.

No problem, I thought – in my Schema.xml for my custom Document library I can specify Hidden=”TRUE” in the ContentType node. Sadly, this doesn’t work entirely well… Continue reading “Control the Content Types in the New menu via code”

Control the Content Types in the New menu via code

List Definitions don't need their own forms…

List definitions don’t need their own forms – if you’re happy with the out of box ones. Mostly, if you use something like the solution generator to create your List definition, it will create a number of forms by default for you:

as-created-by-solution-generator

These are then deployed into your list:

when-deployed-as-seen-in-sharepoint-designer

However, you don’t actually need these in your definition, unless you’re providing your own custom forms! Continue reading “List Definitions don't need their own forms…”

List Definitions don't need their own forms…