We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24598
    • 17 Posts
    My client wants users to view the wayfinder links that are currently hidden because they are members only. Non members are directed to the "registration page," while members go to the actual members only page. Can anyone point me in the right direction?

    I am using Evolution and Weblogin. Half the links are members only, and they are scattered between three menus.
      • 3749
      • 24,544 Posts
      I'm not sure I understand what you want, but if you add the client to the Members group and the client logs in in the front end, he or she should see the links.

      In Revolution, the client could see the links when previewing from the Manager (assuming that the client belongs to the Members user group) without logging in again. There's a way to make that happen in Evolution, but it's somewhat complicated. I think there's a plugin that automatically logs the Manager user into the front end when they log into the Manager. Unfortunately, I can't remember what it's called.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 24598
        • 17 Posts
        Some additional detail in what I am trying to do. I have a two types of users. Members and Non-Members ( basically the general public ). I want to show ditto'd links to everyone. For non-members if they click a link that is restricted to members only area - they are redirected to a registration page. I am using WebLogin 1.1 with Modx evo 1.0.5.

        I was considering using a template variable ( checkLogin with some code like this:

        @EVAL if (!$modx->getLoginUserID()) {
        $redirectPage = $modx->makeUrl(4); <--redirect to the registration page
        $modx->sendRedirect($redirectPage);
        }
        else {
        return "funny!";
        }

        and then placing it within each page but I'm not certain if this a good practice or NOT being new to MODX.

        I also have another slightly nuanced issue with a requirement to show partial content on a page with button like VIEW MORE that would take MEMBERS to the full page BUT redirect NON-Members to a registration page.

        Thanks for any insight.
          • 3749
          • 24,544 Posts
          I would probably use a snippet rather than an @EVAL TV and put the content in a chunk, just to keep the content separate from the code. Your code looks reasonable, though.

          Another way to go would be to put the content in a chunk and use the ismember output modifier.

          Also, if the menu will not be shown on the pages that contain the content, you could just put your redirect code in a snippet and place a tag for that snippet at the top of the pages with the content. That way, everyone would see the links, but when non-members click on them, they get redirected to the registration page.

            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 24598
            • 17 Posts
            Bob - thanks for your replies - does the ismember output modifier work for evolution?
              • 4310
              • 2,310 Posts
              IIRC for Ditto, you shouldn't need anything more than setting your unauthorised page to your login/registration page.
              A Ditto read more link to a protected page would then automatically redirect to the unauthorised page if they aren't logged in with the correct user group/permissions.
              Untested but for Wayfinder to show protected documents you'll probably need to remove the following from the sql query around line 351 in assets/snippets/wayfinder/wayfinder.inc.php
              AND ({$access})
                • 24598
                • 17 Posts
                Awesome - thanks for the suggestions. I'll give it a try and post back the results.
                  • 3749
                  • 24,544 Posts
                  In Evolution (PHX) it's

                  mo

                  * aliases: isinrole, ir, memberof

                  I don't think Evo has the ismember alias.
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting