I have been building a Project Template Site POC for a customer. The template site includes a list which holds the key metrics about the project; Description, sponsor, budget, start time, duration, type etc. There will only ever be one item in this list but when a new site is created from the template I wanted to ensure that the mandatory fields in this list are completed before the other site features can be used.
The solution was to add a Data View Web Part for the list to the home page and change the functionality that detects there are no items to display with some client side javascript code to redirect the browser to the lists NewForm.aspx page.
Here is the string you should look for in the DWP code…
There are no items to show in this view of the "<xsl:value-of select="ddwrt:ListProperty('Title')" />" list. To create a new item, click "New item" above.
Replace this with
<Script language=”javascript”>window.location=”lists/ProjectDetails/NewForm.aspx”</script>
This worked surprisingly well. As soon as the site is created, the user is taken directly to a form to complete the project details. The home page can’t be seen until the record has been created.
Of course this same code could be added to a list view web part but have you seen the source code for the list view? I try and stay away from CAML, that's for people who enjoy pain and suffering (XSL is bad enough).
I fully expect this POC to be implemented in production as a custom site definition so there will be no ghosting issues.
Oh, and there are a bunch of other capabilities with this approach. Just imagine the rollup of all this info...