We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32645
    • 377 Posts
    I have a series of documents that are part of my "premium" membership document group on my site and currently if you are not logged in you are redirected to the site_start.

    I wish to change this. I would like to achieve both of the following if a "web user" is not logged in:

    1. Redirect to a specific page.
    2. Instead of redirecting, present a chunk on a specific page.

    For part 2 this is the scenario;


    // Scenario
    A user visits the ’homepage’. A video is displayed on the ’homepage’ for all logged in web users. However, if you are not logged in, a HTML message is shown instead.

    Is it possible to change the way MODX treats access to a private page?
      • 32645
      • 377 Posts
      I’ve fixed this now.

      1) On a "private" page (ie: a page where its restricted to a "web group") I’ve made it redirect to the "login" page.

      2) On a "public" page (ie: which anyone can view) where there are parts of the website restricted to a "member" of a "web group", I’ve used the MemberCheck snippet. I’ve also, in my tests, used Personalise 2.0 and PHX as follows;

      // here are some tests I did.  Test 1 does not work for some reason, but the rest are fine
      // these are pasted in your content/template textarea box.
      
      <h1>Test 1</h1>
      [*phx:mo=`premium`:then=`{{chk.yesLoggedIn}}`:else=`{{chk.noLoggedOut}}`*]
      
      <h1>Test 2</h1>
      [+phx:mo=`premium`:then=`{{chk.yesLoggedIn}}`:else=`{{chk.noLoggedOut}}`+]
      
      <h1>Test 3</h1>
      [[MemberCheck? &groups=`premium` &chunk=`chk.yesLoggedIn` &default=`chk.noLoggedOut` &debug=`true`]]
      
      <h1>Test 4</h1>
      [[LoggedOrNot? &yesChunk=`chk.yesLoggedIn` &noChunk=`chk.noLoggedOut`]]
      


      *(Thread closed)*