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

    I think this option has to be in Jot somewhere but I can’t seem to find it. I want to display a message to users that haven’t logged in yet before they see the form to add a comment.

    At the moment the form only shows when a user is logged in so when the user is not logged in he should see something like "Please log in to comment"

    Thanks!
      • 3749
      • 24,544 Posts
      I’m not sure if Jot has anything built in for this but, if not, you could use the Personalize snippet, which shows one chunk to logged-in users and another to not-logged-in users.
        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
        • 7231
        • 4,205 Posts
        You can use PHx in Jot form template and add something like this to hide the form is not logged in:
        [+form.guest:is=`1`:then=`<h1>Please log in to comment</h1>`:strip+]
        [+form.guest:is=`0`:then=`
        <form>
        .....put commentform data here
        </form>
        `:strip+]
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don&#39;t know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 19579
          • 51 Posts
          The form is already hidden when not logged in. The problem is getting a message when the form is hidden. So when I change things to the form template it still would not show anything to the not logged in users because the template for the form is not called when the user isn’t logged in.

          Thanks for the suggestions smiley! Any other ideas?
            • 7231
            • 4,205 Posts
            I took a look at the Jot code but it was too much effort for me to figure out for to hack this function in quickly. I would do as BobRay suggested and use the Personalize snippet and place a message on the screen if the user is not logged in. It will place a chunk with your message if the user is not logged in...and you can have a blank chunk if they are logged in. Place the snippet before the form...

            [+jot.html.comments+]
            [+jot.html.moderate+]
            [!Personalize? &yesChunk=`BlankChunkName` &noChunk=`ChunkWithLoginMessage`!]
            [+jot.html.form+]


            It would be nice to have a placeholder for a message that you need to login.

            BTW - Personalize is installed with the default snippet package...if you opted to install them during the installation that is.
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don&#39;t know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 19579
              • 51 Posts
              I solved the problem by using the code in the second post in the following thread:

              http://modxcms.com/forums/index.php/topic,34876.0.html

              I had some issues with the Personalize snippet and that did the trick.

              Thanks for the help!