Mavention Blog
Today we figured out a strange SharePoint behavior. For a customer we’re building a large (publishing) website with SharePoint 2007. We create our own site definitions, of course. In this example we created a site definition in which 2 content types are used an index content type used for the welcome page and a subject content type for multiple subject pages. This site definition rolled out one page, the welcome page, based on the content type ‘index’ with a corresponding page layout.
When building a site based on this definition, everything seemed to work fine. Until… we placed a custom build webpart on the welcome page that does a caml query searching for pages based on the content type ‘subject’. The strange thing was that this query also returned the welcome page, although this page was based on the content type ‘index’.
What we finally found out is that in our site definition we used a content type binding feature to bind the content type ‘subject’ to the pages library of the site. What we forgot was to also bind the content type ‘index’ to the pages library. So the strange thing was that, although we didn’t bind the ‘index’ content type to the pages library, we were able to create a correctly working welcome page that seemed to be based on the ‘index’ content type. Underneath it turned out that this welcome page actually had the ContentTypeId of the subject content type.
So when we made a second content type binding in the site definition that also bound the content type ‘index’ to the pages library, the welcome page actually did get the correct ContentTypeId and didn’t show up in our caml query.

Cheers,
Lennard
 
Posted: 25-3-2010 16:38:18 by Lennard van Leuven | with 0 comments


Both SharePoint 2010 and Office 2010 will be released by then.
You can see the launch online.

See http://blogs.msdn.com/sharepoint/archive/2010/03/05/sharepoint-2010-office-2010-launch.aspx for details
Posted: 9-3-2010 10:54:37 by Marcel van der Lem | with 0 comments