Oh I know how to get the ID out using umbraco.library:Request( 'id' ) and can build the if statement to check its there, its the redirecting that I'm struggling with. I want something like:
That would do it, seems a bit over kill to have to build an extension for it. But I suppose I need to start on that funky "helpers" extention so this might be the first method in there.
Clean redirect from within my XSLT?
Simply problem, I have a product view page which you are meant to get to via a url like this:
/product-indepth.aspx?id=1234
I use urlrewriting to make this all pretty.
I simply want to redirect the user to the homepage if no id is passed through, ie they are trying to hit the page directly.
Can't seem to find a clean, simple, easy way. Am I missing a trick or do I need to create one? :)
Cheers
Pete
Oh I know how to get the ID out using umbraco.library:Request( 'id' ) and can build the if statement to check its there, its the redirecting that I'm struggling with. I want something like:
<xsl:if test="$id = ''">
<xsl:value-of select="some.library:RedirectTo('/homepage.aspx')" />
</xsl:if>
Any ideas?
There is nothing available that I know of but you could make a simple xslt extensions that does something like:
Not much more needed than that right? :-)
That would do it, seems a bit over kill to have to build an extension for it. But I suppose I need to start on that funky "helpers" extention so this might be the first method in there.
Hi Peter,
If you don't want/need a 301 redirect, but rather a 302, you could spew some crude JavaScript into the page, to preform the redirect...
/Chriztian
Or, for now, I think you could get away with some inline C# and not have to create a whole VS project (check XSLTSearch to see how Doug has done it).
is working on a reply...