This is in the context of MOSS 2007.
I have a custom site definition. Currently in ONET.xml we have the following Module:
<View List="$Resources:core,lists_Folder;/$Resources:core,announce_Folder;" BaseViewID="0" WebPartZoneID="Left" WebPartOrder="1" />
You'll notice that this is a site with the publishing features activated and the default.aspx page is provisioned to the Pages library. This correctly provisions the page to the Pages library with an Announcements List View web part provisioned to the page.
I have about 800 (or so) sites created from this site definition. We have a need to add a few web parts to the page for any new sites created from the template and also for all of the existing 800 sites.
The plan was to move the default.aspx module from ONET and into a feature, then reference the feature from ONET. Once this was done, generate a series of stsadm deactivatefeature and activatefeature commands to get the home page the way we needed for all existing sties. New sites would pick it up via the feature.
When I do this I can deactivate and reactivate the feature to correctly replace the home page with the "latest version". However, when I create new sites (for example using Central Admin or through the API using SPWebApplication.Sites.Add()), the site creation fails with a very generic "Cannot complete this action. Please try again." error message. Digging through the 12\Logs, I found a little more detail:
Failed to find a suitable list for tag in module for file 'Pages/default.aspx' given List attribute 'Lists/Announcements'.
If I take the element out of the , things work fine (but this obviously is not what I want). I've tried a number of things, such as replacing the "List='104'", trying with other list types, etc. All with same/similar result.
Do elements work when are provisioned to "Pages" library? Is there an a way to get this to work correctly? Is there a suitable workaround to allow me to configure my site definition to create the correct web parts for existing sites and any new sites?