No Thumbnails for Custom Picture Library Definition

 

 

No Thumbnails for Custom Picture Library Definition

I’ve got a Custom Picture Library definition – it encapsulates much of the same functionality I described a few days ago for Document Libraries. I built it, then ran Solution Generator against it to create the List definition and schema.

It all seemed to work alright, but when I tried uploading an image, it didn’t create my thumbnails, or the _w and _t folders the thumbnails are hidden in! This was a problem.

Well, I cracked open reflector (how did we do .NET development before it?) and dug around. Didn’t find much, except that the Upload.aspx page decides if it is for a Picture Library based on the List Template’s Type attribute (ordinarily 109).

The Type attribute of a List Template tag says this:

Provides a unique identifier for the template. This identifier must be unique within the feature, but need not be unique across all feature definitions or site definitions.

This attribute corresponds to the Type attribute of the List element

Hmm. Interesting. I had changed my List Template’s Type – I’ve been keeping all of mine unique in my solution, as I do have multiple lists based on the same out-of-box type (e.g. multiple lists based upon the ‘Custom List’ type).  As I was suspicious, I changed this back to 109, and tried again. My thumbnails now worked.

I guess that this mean that the thumbnailing done during the upload process is contingent on the list’s Type being 109 still. As a consequence, I guess that a feature can only have one custom Picture Library definition (as “This identifier must be unique within the feature”).

5 Comments so far

  1. Jeroen Van Bastelaere on May 25th, 2009

    Hi,

    If you really want to you can create an event receiver and make the logic yourself of creating a thumbnail inside _w and _t.
    I have encountered this same problem a while back and this also works.

    Regards,
    Jeroen

  2. Andy on May 26th, 2009

    Hi Jeroen,

    Yup, that’s a good approach. I prototyped it a while back, and it worked okay. I’d just sooner avoid reinventing the wheel if I can. I’ll just use 109 for now!

  3. Matt on July 6th, 2009

    I did the same thing as you but when I remove the feature it messes up the ability of sharepoint to run the site manager saying feature xxx-xx-x-xx for list template 109 is not installed on this farm.

    Any thoughts about that issue?

    Error goes something like this: “Feature ‘bbc8d48a-6fe9-493d-a035-0f7cdfc1377f’ for list template ‘109′ is not installed in this farm. The operation could not be completed. at Microsoft.SharePoint.SPFeatureManager.GetFeatureRootAndListSchemaPaths(Guid featid, Int32 ltid, String& sPathToFeatureRoot, String& sPathToSchemaXml)”

  4. Jens on October 20th, 2009

    Hi!

    I have this problem, and changing back to type=109 would do it. But what if you have a custom action in your picture library that you only want on your custom list defintion?
    Any ideas?

  5. Andy on October 21st, 2009

    Hmm. That’s a good question. It looks like it might not be possible as a CustomAction.

    I’d be delighted to hear if you find a solution, though.

posted on 2009-11-26 22:18  黑木 Kang  阅读(382)  评论(0编辑  收藏  举报

导航