Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Drew 165 posts 340 karma points
    Mar 02, 2011 @ 16:39
    Drew
    0

    Simple Redirect Macro ?

    I've created a master doctype with a "hide" attribute/property which all content pages can set.

    To stop users viewing a page which has been flagged as hidden, I need to write a macro which redirect the user back to the home page, or a 'sorry' page.


    Unfortunately, although I've dabbled with XSLT and macro's, I just can't seem to get very far at all!

    Can anyone please help me out, is a macro the right way to go about it?

     


    * I know about all the umbraco redirect built-in features. I've simplified my problem for explaination reason. I actually detect if a user is accessing the site from a mobile browser, if so I tag on the alttemplate with the MobileBrowser Template.aspx - but not all pages should be visible to mobile browsers - so I need a way to redirect them if they try accessing a page which has its 'hide from mobile browser visitors' property set to true :)

     

     

  • Drew 165 posts 340 karma points
    Mar 02, 2011 @ 16:45
    Drew
    0

    << ok, below is a better post. I tried to 'edit' and also 'delete' my original post - but both options throw exceptions on the forum! >>

    I've created a master doctype with a "hide" attribute/property which all content pages have, and can be set for each content page.

    To stop users viewing a page which has been flagged as 'hidden', I need to write a macro which redirects the user back to the home page, or a 'sorry, not for you' page.

    Unfortunately, although I've dabbled with XSLT and macro's, I just can't seem to get very far at all!

    I've seen suggestions to embed C# in the XSLT macro and use C#'s Server.Refer or Reponse.Redirect, rather than relying on Javascript - which could be turned off on the mobile browser...giving them access to a 'hidden' page.

    Can anyone please help me out, is a macro the right way to go about it?


    * I've simplified my problem for explaination. I actually detect if a user is accessing the site from a mobile browser, if so I tag on the alttemplate with the MobileBrowser Template.aspx to the URL - but not all pages should be visible to mobile browsers - so I need a way to redirect them if they try accessing a page which has its 'hide from mobile browser visitors' property set to true :)

     

Please Sign in or register to post replies

Write your reply to:

Draft