We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5476
    • 6 Posts
    Hi everybody,

    I would like if it’s possible with modX to show differents pages if different type of visitor come to the site.

    Exemple
    --------------------------------
    First, there will be e special additionnal requiered field in the login form with two states

    *man
    *woman

    after login, men will be automatically redirected to sub home page B
    women to sub home page C
    of course first time visitor stay on home page A until they decide to fill the login form


    I don’t want to have to put manualy the registered user in custom groups.

    Thanks for the help if you have the code.


      • 32963
      • 1,732 Posts
      Hi,

      Try this:

      1) create a snippet called AfterLogin
      2) inside the snippet you can add the code:
      if($_POST['type']=='man') {
         // redirect if man was selected
         $url = $modx->makeUrl(12);// page id 
         $modx->sendRedirect($url); // redirect to url
      }else if($_POST['type']=='man') {
         // redirect if man was selected
         $url = $modx->makeUrl(12);// page id 
         $modx->sendRedirect($url); // redirect to url
      }

      3) Save the snippet
      4) add the snippet to the login home page as [[AfterLogin]]

        xWisdom
        www.xwisdomhtml.com
        The fear of the Lord is the beginning of wisdom:
        MODx Co-Founder - Create and do more with less.
        • 5476
        • 6 Posts
        Quote from: xwisdom at Nov 21, 2005, 09:04 PM

        Hi,

        Try this:

        1) create a snippet called AfterLogin
        2) inside the snippet you can add the code:
        if($_POST['type']=='man') {
           // redirect if man was selected
           $url = $modx->makeUrl(12);// page id 
           $modx->sendRedirect($url); // redirect to url
        }else if($_POST['type']=='man') {
           // redirect if man was selected
           $url = $modx->makeUrl(12);// page id 
           $modx->sendRedirect($url); // redirect to url
        }

        3) Save the snippet
        4) add the snippet to the login home page as [[AfterLogin]]



        Thank you very much I will try this..; the MODx support is awesome
          • 6726
          • 7,075 Posts
          Yeah support is awesome smiley

          Clo75, basically your idea is the first step toward UI levels... something I’d very much like to see implemted in MODx. I’ll try this bit of code, could be useful for multi-language websites...

          Thanks Raymond !
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l'outil id