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

    I’m trying to have a page that is a login page for staff members which is linked in the main navigation, now is it possible that once a staff member logs in the same page loads but now with available content on it? Or does it have to be a new page, the only reason i ask is because im not sure how I would link that logged in page from the main navigation.

    Does that make sense?

    Thanks
    Brett

      • 28215
      • 4,149 Posts
      <!-- my html here -->
      <div>
      </div>
      [[!+modx.user.username:notempty=`
      <!-- content for logged in users here -->
      <header>Staff Area</header>
      <p>etc</p>
      `]]
      
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 22969
        • 158 Posts
        Thank you for that, how do I make the login form return to the same page when a user logs in?

        Thanks again.
          • 22969
          • 158 Posts
          Hi Shaun

          I tried adding that code to under my login form, but the content is vieiwable when i hit that page even before logging in, what am I doing wrong?

          Any pointers would be great.

          Brett
            • 22969
            • 158 Posts
            Anyone have any ideas??

            Im stuck on this at the moment :-(

            Thanks
              • 24531
              • 213 Posts
              try to test it in another browser, where you’re not logged in as admin in mgr context.

              you can also try to use If snippet
              [[!If?
                 &subject=`[[+modx.user.id]]`
                 &operator=`notempty`
                 &then=`<!-- content for logged in users here -->
              <header>Staff Area</header>
              <p>etc</p>`
                 &else=``
              ]]
              

              however, id does pretty much the same thing.
                • 3749
                • 24,544 Posts
                Be sure you’re using:

                [[!+modx.user.username:notempty=


                not

                [[+modx.user.username:notempty=


                The exclamation point makes the tag uncached.
                  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