• Resolved kastriotsula

    (@kastriotsula)


    Hello,

    in a previus version of this plugin I was able to add a script inside this textarea.

    But this is not working anymore.

    Is there any hook or any solution so I can use to execute this code:

    <script type="text/javascript">
       var userLang = window.navigator.language || window.navigator.userLanguage; 
       if(userLang.toLowerCase().indexOf("it")>-1) location.href = "/area-riservata/benvenuto/";
    	else location.href = "/en/private-area/welcome/";
    
    	 </script>

    https://ibb.co/HXfRYQV

    • This topic was modified 4 years, 2 months ago by kastriotsula.
    • This topic was modified 4 years, 2 months ago by kastriotsula.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Aswin Giri

    (@aswingiri)

    Hello @kastriotsula

    You can try this snippet

    Thread Starter kastriotsula

    (@kastriotsula)

    @aswingiri Thank you for your response!

    As I see this snippet apply this filter on all the websites pages, but as I have set some pages to be public and some private with access to a specific user role, this script for what I see runs on all pages, I need this filter to be applyed only on pages that are restricted on the backend.

    For example:

    Homepage –> Public
    About us –> Public
    ..
    ..
    ..
    Private Area –> Only who has an account with a specific role can access
    Other private page –> Only who has an account with a specific role can access
    ..
    ..

    Here the settings in the backend:

    Restricted page:
    https://ibb.co/hD7wb54

    Public page:
    https://ibb.co/98jtk8P

    • This reply was modified 4 years, 2 months ago by kastriotsula.
    Plugin Support Aswin Giri

    (@aswingiri)

    Hello @kastriotsula

    I have updated the snippet, please check it now. This should only add the script when the restriction message is displayed on-page. Let me know if this works.

    • This reply was modified 4 years, 2 months ago by Aswin Giri.
    Thread Starter kastriotsula

    (@kastriotsula)

    Looks good to me! That’s exactly what I meant!

    Thank you very much @aswingiri 🙂

    • This reply was modified 4 years, 2 months ago by kastriotsula.
    Thread Starter kastriotsula

    (@kastriotsula)

    Sorry @aswingiri but see that the script still runs on pages that are not protected using Ulitmate member.

    What can be the problem?

    Thanl you again!

    Plugin Support Aswin Giri

    (@aswingiri)

    @kastriotsula I have tested this snippet and this seems to work fine. Can you please see if you have added script on any other places?

    To make sure it is not the snippet, you can remove the snippet and see if the script still loads. If you have any caching systems on your server or website, please disable them and test it.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Custom script inside of Restricted Access Message’ is closed to new replies.