5

I’ll keep it short and sweet. Does anyone really know what the "ListTemplateOwner" tag of the elements.xml's "Receivers" node really means?

From Microsoft’s site: http://msdn.microsoft.com/en-us/library/ms431081(loband).aspx

ListTemplateOwner: Optional Text. Specifies the GUID of the list template owner if the list template is registered via Features, or the name of the site definition if the list template is registered by a site definition.

3 Answers 3

2

If the list is defined by a ListTemplate in a Feature then ListTemplateOwner is the ID of the feature that defined the list.

When you're refering to any of the standard lists (with ListTemplateId < 10000) then you don't need to specify a ListTemplateOwner (due to backwards compability)

When you're refering to a list that's defined by you or a third party, then you need the combination of ListTemplateId (> 10000 and matching the Type attribute from the defining ListTemplate) and ListTemplateOwner matching the FeatureId of the feature that defined the ListTemplate.

This is due to the fact that when you define a ListTemplate the rule is that Type should be > 10000 and unique inside the feature, but any number of feature may have their own ListTemplate with type 10001 (and feature which define lists usually just start from 10001)

If the list is defined by a ListTemplate in a Site definition then ListTemplateOwner is the name of that Site Definition, but don't define lists in Site definitions do it in features.

1

This is not correct, the feature ID when set to the current feature, which contains the list definition for the list type, does not target the reciever correctly...

<ListTemplate
    Name="SomeList"
    Type="99002"
    BaseType="0"
    OnQuickLaunch="TRUE"
    SecurityBits="11"
    Sequence="410"
    DisplayName="Some List"
    Description="Custom List used for whatnot"
    Image="/_layouts/images/itgen.gif"/>

<Receivers ListTemplateId="99002" ListTemplateOwner="B1E4631D-52A1-48d0-A319-2DDC2893AA57">

What you need to do is give each List Template a unique ID, regardless of the owning feature.

0

I am guessing that it refers to the ID (GUID) of the SharePoint object that owns the list template. Think of it like the ID column of a database and this would be it's foreign key.

18
  • Thanks for your response. Would you happen to know where I can find this GUID/ID? I don't think it's the Feature Id.
    – Danny
    Apr 24, 2009 at 16:54
  • Actually, let me rephrase my comment. I not exactly sure what you mean “SharePoint object”. Can you elaborate on this and how do I get its GUID/ID?
    – Danny
    Apr 24, 2009 at 17:01
  • SharePoint object is really anything managed in SharePoint whether it be a list, list item, site, site collection, etc.... The GUID is the ID of it in the content database. I don't fully understand what you mean by how you would get it. Do you need to know what it is? In feature installation, it would be set automagically.
    – theG
    Apr 24, 2009 at 17:09
  • When you create a feature you have the opportunity to set it. <Elements ...> <ListTemplate Type=”100” .../> <Receivers ListTemplateId="100" ListTemplateOwner="?????"> ... </ Receivers> </Elements> I’m having a hard time pinpointing what it actually does. I thought it was used to add some more context to what list type gets affected. My question here is purely academic but I have a deep desire to figure this out ;)
    – Danny
    Apr 24, 2009 at 17:33
  • I wonder if it might be a way to tie a group of Receivers to a specific element. If you had more than one <Receivers> block, you could specify a specific object for each block.
    – theG
    Apr 24, 2009 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.