Tuesday, December 8, 2009

Redirect using a Content Editor Web Part

I am not a web developer, so when someone asked me to create a redirect for a page, I was at a loss. Then someone told me to use a Content Editor Web Part. Wow. It really is that simple.

Add the CEWP to the page. Then click Edit Shared Web Part and click on Source Editor.

Modify the code below to include the site you want to redirect to and add any pertinent text. The HTML below redirects in 5 seconds, but you can shorten or lengthen that by changing the setTimeout.

<HTML>
<HEAD>
<SCRIPT language="JavaScript">
<!--
function redirectsp()
{
top.location="http://YOURSITE HERE";
}
if (top.frames.length==0)
{
setTimeout('redirectsp()',5000);
}
//-->
</SCRIPT>
</HEAD>
<body>
<TABLE width=70% align=center cellpadding=10><TBODY bgcolor=#EOEBED><TR><TD><STRONG><FONT size=4 color=#59452A><BR>You will be redirected here: <FONT face=Verdana><A href="http:/yoursite/default.aspx">http://yoursite/default.aspx</A> Please bookmark it for future reference. You will be redirected in 5 seconds or you may click on the link to go there immediately.<BR><BR></FONT></FONT></STRONG></TD></TR></TBODY></TABLE>
</body>
</html>

3 comments:

  1. Thanks,
    This worked when a couple other embedded script options did not work. I appreciate your work.

    Steve Moore

    ReplyDelete
  2. Sferyx JSyndrome has a full range of functionalities as compared to popular web authoring packages and also provides recognizable text processing interface. This editor component can be fully customized as per requirement

    php editor

    ReplyDelete