We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5854
    • 39 Posts
    Hey smiley!

    Website-page in question: http://www.fiery-legends.de/index.php?id=60

    MODX version: latest

    I have a few questions and problems so any help would be greatly appreciated!!

    1. I want to change the order of the comments displayed by defaul(I wanted the comments first then the form) so I made the custom Jot call and it is as follows- however, no comments are displayed! Why? sad

    [!Jot? &captcha=`0` &moderated=`1` &canmoderate=`Admins` &subscribe=`1` &pagination=`5` &notifyAuthor=`1` &sortby=`createdon:a` &placeholders=`1` &output=`0` !]
    <h6> Comments</h6>
    [+jot.html.comments+]
    [+jot.html.navigation+]
    [+jot.html.moderate+]
    [+jot.html.form+]


    2. Is there a way to design the templates in such a way that all any user has to do is enter a comment and the name is automatically his username? Thing is, I only want one text-box and that for the "comment" and I don’t want the user to have to add his name, e-mail etc..is this possible? Has anyone done it?
    • If you have the PHx plugin installed and enabled, you will not be able to use the placeholders in your content like that. PHx eats placeholders in the content.

      You can work around this by having separate Jot calls with different parameters to only show the form, or only show the comments. Or, you can use the Jot call you have, and write snippets to pull out the placeholders from the $modx->placeholders array:
      $comments = $modx->getPlaceholder('jot.html.comments');
      return $comments;
      


      If the user is logged in, it will automatically use his username. You will have to customize your own tpl for the comment formatting. Be warned that Jot tpls use Jot’s internal PHx (not the plugin) and the tpls take a bit of studying to figure out.
        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
        • 16278
        • 928 Posts
        If you have the PHx plugin installed and enabled, you will not be able to use the placeholders in your content like that.
        Beg to differ! The Pogwatch blog has PHx plugin enabled and uses the code below in the template for individual posts. The big difference from Counterfire’s call is that my Jot call is cached, while the page is not cacheable (via Page Settings). As far as I recallAs noted in the blog, I hit on this by experiment after having to apply the same technique with Ditto pagination. Presumably the caching aspect is what PHx plugin interferes with.
        laugh KP

        [[Jot? &subscribe=`0` &pagination=`20` &sortby=`createdon:a` &numdir=`0` &placeholders=`1` &output=`0` 
        &canmoderate=`<blogger group>` &captcha=`1` &validate=`name:Name is required,content:You have not entered any comment!` 
        &notify=`2` &badwords=`{{blogBadwordList}}` &bw=`1`]]
        <div id="blogComment">
        <h4 id="blogCommentTop">Comments ([[Jot?&action=`count-comments`]])</h4>
        [+jot.html.comments+]
        [+jot.html.form+]
        </div>
          • 5854
          • 39 Posts
          Ok, but I have now made my call "cachable" and I now have the form in the right place but no comments are either being shown or the form is not responding to have registered the comment...any ideas why?

          Page in question: http://www.fiery-legends.de/index.php?id=60

          [[Jot? &captcha=`0` &canmoderate=`Admins` &subscribe=`1` &pagination=`5` &notifyAuthor=`1` &sortby=`createdon:a` &placeholders=`1` &output=`0` ]]
          <h6>Comments</h6>
          [+jot.html.comments+]
          [+jot.html.form+]


          Best Regards,

          AR
          • So the document must be uncached, and the snippet cached.

            That is interesting. I ran some tests and was not able to use any placeholders from any snippet in the content, but I’m not sure if the documents themselves were cached/uncached.

            I can see where this would make sense, as cached snippets are not processed until the post-processing stage, where the PHx plugin would have already done its own cleanup of unused placeholders.
              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
              • 5854
              • 39 Posts
              IT WORKS!

              So, what I did was make my call cached ([[ ]]) and make the news page uncached!