Mar 17, 2009

Redirect now, not in 5 secs

SharePoint publishing portal has this useful page type, the redirect page.By using redirection pages, you enable contextual navigationand thus an easier user experience. The data is in one place, and one place only, but can appear in multiple places. The concept is simple: create a new redirect page to the site where the data should contextually appear (as well as in it's original place) and fill in the URL of the target site/page.



But, for some reason the redirection delay is set for 5 seconds, by default. Which creates a somewhat awckward experience for the end user. And unfortunately this can't be changed anywhere in the page settings. Yet, fortunately, it is not hard coded into the very sole of the control, but actually is very easily changed by changing the value of the delay-attribute of the control.

The redirect page is based on the redirect page layout. It is stored in the Site Collection Master Pages and Page Layouts gallery and can be opened in SharePoint Designer. Of course, modifying the page layout will effect every redirect page in the Site Collection, but then again, only in that one Site Collection. So, if you need a 5 sec delay on one page and rather have no delay on another page, the simple answer is to copy-paste-rename the redirect page layout in the gallery.

Anyhow, the small operation for changing the delay is to open the redirect page layout (RedirectPageLayout.aspx is the original one) to be modified e.g. in SharePoint Designer, go to the code view and set the attribute:

PublishingWebControls:RedirectControl SecondsBeforeRedirect="5"


Set the value of the SecondsBeforeRedirect to any number of seconds - it can also be 0 (zero). But note that when there is no actual redirection delay, the page is not available for modification except via the page library (because it does not show in the browser long enought to be opened for modifying).

4 comments:

Anonymous said...

Hi, I followed this steps and it works like charm as long as you are not logged in to the site! But if you sign in to the site, it again shows a delay of almost one second. Do anyone know how to solve this?

Thanks,

Paul Grimley said...

Great thanks for this.

Paul

Anonymous said...

I am a site collection admin and cannot edit the redirect page layout in the Master Page gallery. I get the message, "This page does not have any regions you are allowed to edit." Why might that be? I have enabled all the SPD settings at the site collection level and in Central Administration for this web application.

SM said...

In SPD, when you get that message, you need to click on Advanced edit (in the Ribbon) in order to be able to edit the page layout.