Copied to clipboard

Flag this post as spam?

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


  • Ilya Denisov 2 posts 22 karma points
    Jul 01, 2020 @ 12:18
    Ilya Denisov
    0

    Custom default redirects

    Hi! Newbie here!

    I need to implement the scenario, when there is some specific pages, so when user is visited them, then the last visited specific page is saved in the cookie and next time, when user is opening the site via http://www.sitename.com/ link, it will be redirected to that specific saved page.

    Can someone point me, please, to the reference page describing such functionality of Umbraco or suggest the proper solution for such case?

    Thank you!

  • Dhanesh Kumar MJ 125 posts 388 karma points
    Jul 01, 2020 @ 13:16
    Dhanesh Kumar MJ
    0

    Hey,

    You can save the url from window.location after the dom loaded using jQuery or normal js. And next time customer open the website, check whether the cookie has value in server side, if yes then redirected to the page. Make sense?

  • Ilya Denisov 2 posts 22 karma points
    Jul 01, 2020 @ 14:35
    Ilya Denisov
    0

    If I understood you correctly, I should inject the JS code in the each necessary page, so it will save the URL in the Cookie and then reuse it in the Server-Side, when the root of the site is called?

    I'm just wondering, if there is an built-in solution for such kind of scenarios?

  • Dhanesh Kumar MJ 125 posts 388 karma points
    Jul 01, 2020 @ 15:29
    Dhanesh Kumar MJ
    0

    Hey

    I don't think or I don't know that there is a dedicated package for this in Umbraco.

    But this is quite simple. No need to inject in each page. You can write it in layout itself and differentiate the logic based on the doctype alias

  • Graham Davis 107 posts 362 karma points
    Jul 01, 2020 @ 15:32
    Graham Davis
    0

    Inject the code in either the Master layout or into the template(s) that you want to use it

Please Sign in or register to post replies

Write your reply to:

Draft