Well, what an adventure. How how hard can it be, was what I thought:

  1. Create a custom content type with custom site columns
  2. Create a custom page layout
  3. Let it come together in the onet.xml of my custom site definition

(I think there are enough articles which describe the above steps in detail)

I don't know where it went wrong, but after I created a new site based on my custom site definition the following issues appeared:

  1. My custom pagelayout wasn't loading, but some default page layout (the sharepoint controls for my fields and my usercontrol were gone)
  2. I went to the pages list of my site, I did see my page and even my custom page layout (??). I can even click on the link of the page layout which shows the correct page layout
  3. When I go to the page settings the page, I am missing the option to choose a page layout 
  4. And last; If I create a new page in that list manually, it works fine!

Okay, now you want to know what the h#ll was the problem. Well, in all my experimenting and changes all around somewhere the incorrect default page was copied in my site definition.

The solution is easy (knowing what I know now):

  • Copy the default.aspx from /12/TEMPLATES/Site Templates/PUBLISHING to my own site definition folder (I have used the publising site as starting point)
  • Do an IISRESET
  • Create a new site

It seems like a stupid problem, but when you get caught up in the details you easally lose the overview. So beside this post I would like to recommend everyone with strange, inexplicable problems with Sharepoint to go back to the basic / starting point and build up you solution step by step untill you get to the problem.

Hope you can use it.