SharePoint of the Day #55

When you are creating a custom site definition you can set the ExecuteUrl of the onet.xml Project element to a site-relative URL. When users create new sites from the definition they will be sent to the ExecuteUrl instead of the home page when the site is first created.

You can use this to send your users to a custom page to setup more advanced features of your site.

Post to Twitter Post to Delicious Delicious Post to Digg Digg This Post

Posted under Developer

This post was written by spotd on June 16, 2009

Tags:

Like this tip? Hate it? Vote here

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading ... Loading ...

2 Comments so far

  1. Sandeep June 17, 2009 3:40 am

    This redirection will not work if u r creating RootWeb , also it will only work with STS and meeting workspace template only

  2. spotd June 17, 2009 4:10 am

    Hi Sandeep!

    You are almost correct on the RootWeb issue, but it would be more correct to say that it will not work if you are creating a site collection through the Central Administration. However, in some cases, you can manage to create a site collection in which a RootWeb template is not applied, for example if there is an error in the site definition user. In these cases, the first request to the site collection will spawn a Create Site page to set up the RootWeb, and the ExecuteUrl will work. However, the situations in which this is usable for a root site are obscure, so consider this a method for creating sites only, not for site collections.

    I am not sure what you mean by only working with STS and MWS, though. When you are creating a custom site definition you are not using any of the two existing templates you mention, but rather creating your own. And I can guarantee you that it does work very well when creating your own, custom site definition.

    If you want an example of how this can be used, check out my uncle’s Building the SharePoint User Experience book, on page 313.

    SpotD

What do you think if this tip?

Name (required)

Email (required)

Website

Comments

More Blog Post

Previous Post: SharePoint of the Day #54