We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10525
    • 247 Posts
    I'm running through the docs for the Login snippet, testing prior to using in a new site.

    There are a fair few items which, although included in the docs, are very cryptic and not self-explanatory. For example, can anyone explain to me what the following means:

    logoutMsg - Optional label message for logout action. If blank, will default to lexicon string for Logout.

    (from http://rtfm.modx.com/extras/revo/login/login.login)

    I have added "&logoutMsg=`Goodbye!`" to my snippet call, but don't see this text when I logout. This seems to be the only mention of this property in the docs and I can't find any examples of it use.

    Thanks.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      From the wording "optional label message for logout action" I would think that this would mean the text of the logout link.
        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
        • 10525
        • 247 Posts
        Thanks sottwell for my fastest response by far! smiley

        Yes, that would sound like a reasonable assumption, but I have my logout link set up as described in the docs:
        <a href="[[~6? &service=`logout`]]" title="Logout">Logout</a>
        &logoutMsg doesn't change that.

        I'm sure I'm just being daft or unimaginitive, but then I'm exactly what the docs are for...
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          If you visit the page that has the Login snippet on it while you're logged in, and you didn't override the &logoutTpl, then that should show you give you the "Goodbye!" message as logout link in your example.
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Here's the relevant part of the default logout tpl
            <a href="[[+logoutUrl]]" title="[[+actionMsg]]">[[+actionMsg]]</a>

            So you could use the [[+actionMsg]] placeholder in your tpl as well, and it would change according to your snippet's property.

            It's always a good idea to use the default tpl as your custom tpl's code, make sure it works, then start modifying your custom tpl.
              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
              • 10525
              • 247 Posts
              Mark, thanks for that, you were right. Sottwell, thanks for the tip.

              As I was just saying to Bob Ray on a related thread about Login, my angst was caused in part by Chrome apparently not clearing out its cache (even with the Cache Killer addon enabled), so I was getting a stream of 'wrong' behaviour. Firefox seemed better, but didn't convince me completely. I ended up not getting the expected behaviour till I went home from work and opened the page on different computer!