We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38183
    • 4 Posts
    I guess for the experts this is a simple thing to do but I can't figure it out. I understand to show menu items with wayfinder after a login is performed (newest version of revo); I just use a resource group for the page and the page is enabled to show in the menu.
    Now I would like to do the opposite, i.e. hide a menu item (resource) which is normally visualised in the menu before login after a user has had a successful login. Anybody has a tip?

    This question has been answered by sottwell. See the first response.

    • discuss.answer
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You could use an output modifier in the Wayfinder snippet to add an "excludeDocs" property
      [[!Wayfinder?
      [[!+modx.user.id:memberof=`Somegroup`:then=`&excludeDocs=`45``]]
      ...
      ]] 


      Both your menu and the user placeholder have to be uncached, since they will change for each user. [ed. note: sottwell last edited this post 12 years, 1 month ago.]
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 38183
        • 4 Posts
        Quote from: sottwell at Aug 23, 2014, 09:52 AM
        You could use an output modifier in the Wayfinder snippet to add an "excludeDocs" property
        [[!Wayfinder?
        [[!+modx.user.id:memberof=`Somegroup`:then=`&excludeDocs=`45``]]
        ...
        ]] 


        Both your menu and the user placeholder have to be uncached, since they will change for each user.

        That's the trick I guess. I didn't know about the :then clause in wayfinder, I'll have a try. Many thanks!
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          That has nothing to do with Wayfinder. The whole [[+modx.user...]] bit is an output modifier, using the provided modx.user placeholders.

          http://rtfm.modx.com/revolution/2.x/making-sites-with-modx/customizing-content/input-and-output-filters-%28output-modifiers%29
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org