We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14673
    • 18 Posts
    I’ve been having some fun getting QuipReply to work and have ended up pretty well stumped, was hoping someone here might be able to help. Essentially I’ve put together a blog section on my site following the instructions in this tutorial: http://rtfm.modx.com/display/revolution20/Creating+a+Blog+in+MODx+Revolution.

    It’s all worked great, but I wanted to take it one step further - basically I wanted the ability to enable or disable commenting on a per-post basis.
    So what I did was create a TV called "comments" (using a simple checkbox input type), that, when checked, would be set to "1". Then, in my post chunks and templates, I used code like this:
    [[*comments:notempty=`<a href="[[~[[*id]]]]#comments" class="comments">Comments ([[!QuipCount? &thread=`[[*id]]`]])</a>`]]

    This worked perfectly for any Quip and QuipCount calls I tried. But I haven’t been able to make it work for QuipReply at all - whenever I try it, I just get no return from the snippet at all.

    I’ve tried it like this:
    [[*coments:notempty=`[[!QuipReply? &thread=`[[*id]]` &maxDepth=`2` &replyResourceId=`[[*id]]` &closeAfter=`30` &moderate=`1` &moderateAnonymousOnly=`1` &moderatorGroup=`comment-mods` &recaptcha=`1`]]`]]

    And also like this (using the "if" snippet):
    [[If? &subject=`[[*comments]]` &operator=`EQ` &operand=`1` &then=`[[!QuipReply? &thread=`[[*id]]` &maxDepth=`2` &replyResourceId=`[[*id]]` &closeAfter=`30` &moderate=`1` &moderateAnonymousOnly=`1` &moderatorGroup=`comment-mods` &recaptcha=`1`]]` &else=`Comments are disabled for this post`]]

    But don’t get any results from either.

    Any ideas?
      • 14673
      • 18 Posts
      Alternatively if there’s a better way of enabling comments on a per-post basis that I’ve missed, that would be great.
      • I recently started using Revo and I faced this same issue doing exactly the same thing.

        I know this does not directly answers your question but perhaps it will give you an alternative solution.

        Based on my experience with MODX using Templates in a smart way has helped me avoid situations where conditionals may otherwise be the only choice.

        Since Template Variable permissions rely on Template assignation what I usually do is that I create subsets of a given template so that I can keep my template variables assigned to the templates they will affect instead of just placing them all over the place. So if I use a TV for a setting or a value that will only be utilize on the homepage, I don’t see that template variable on my inside pages.

        So lets say for my blog I have two templates, my homepage template and my inside pages template. Both of these templates are linked to the same chunks so that I can keep my theme centralized. I then choose what each template holds by linking to their corresponding chunks and this gives me the option for further per-template customization such as the want you want to achieve above.

        In such case, I don’t need an if snippet since all my blog posts are using a template which has this code within it. If you want to have an alternative template that does not include comments, then you can simply duplicate that template and remove the quip code there. Then you decide which template to apply for each blog post.

        I know this may sound as an overall complicated for a very simple thing but utilizing this technique has helped me achieve many things that may otherwise feel complicated. Separating Templates and assigning TV’s on a per-template basis and coding my design in blocks I can re-utilize by calling them in chunks gives me great freedom over the design of each individual page by tweeking the templates and at the same time keeping my main template code centralized in several chunks.

        I hope this helps out.

        Jose R. Lopez
          • 3749
          • 24,544 Posts
          I’ve never done this, but couldn’t you put all the comment code in a chunk and use a template variable with two radio options -- one set to @chunk QuipReplyCodeChunk and the other setting the TV to an empty chunk (or an alternative chunk).

          The TV’s Input Option Values would look something like this:

          Comments==@CHUNK QuipReplyCodeChunk||No Comments==@ OtherChunk
            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
            • 34123
            • 103 Posts
            Hi,

            I have the same issue on my website, I setup a TV, and with the IF snippet i setup a condition, if HideComment is empty Modx show the Quip form.

            I try to show the QuipReply form, but it doesn’t work at all.

            Have you been able to fix your issue jono1 ?

            Frost
              Configuration Apache + Modx + MSSQL 2008
              ===============================
              Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.8
              OS : Windows 2008 R2
              SGBDR : Microsoft SQL Server 2008 (express)
              • 14673
              • 18 Posts
              Sorry for the (very) late reply, there were some significant delays on this site and I’ve only just been able to get back to looking at this stuff.

              Thanks for that idea BobRay, it worked a treat!