My MODx Revolution

Using Only One Form in MODx Quip Comments

Comments form for MODx that's better than Wordpress'

RequestDEMO

  • Without AJAX or other page redirection, I want my Quip Reply-to form to be on the same page as the article, and to process smoothly.
  • Like CSS-Tricks' but unlike Design Couch's, I want to use only one form for the main Quip Comment and Reply-to.

Please ensure your Quip is already working and running all nicely

STEPS

  1. Check out this sweet code... modify your !Quip calls and add one jQuery function.
  2. Optional: the demo uses the best accordion script in the planet; tweak the code above to remove the dependency.
code

The idea

Normally when you hit the reply link, &replyResourceId=`75` will force the page to redirect to resource 75, causing a very nasty experience.
One ugly solution which worked for us in the past was to call resource 75 via AJAX on clicking reply.

Jesse Couch proposed a solution in the forum, but the implementation, though ingenious and working, has the potential of having HTML forms littered every which way; although these forms are hidden by an accordion script and created on the fly, it makes for a not smooth experience, in my opinion. I don't think a user needs to reply to multiple comments simultaneously.

Solution

Do what Wordpress has been doing, use one form for everything. 
Keep &replyResourceId=`75` in case of whatnot, but alter the reply link.
Use jQuery's insertBefore to relocate the main form to a reply link whenever $this reply link is clicked. Enjoy!

21 Comment(s)

    Excellent-Functionality

    Mar 13, 2015 at 04:21 PM

    You know you've spent too much time with MODX when...


    ..you use backticks in your emails and Word docs instead of quotes.
    ..you've forgotten how to say `no` to the question: `is it possible to do on my site...?`
    ..you create snippets to do ordinary tasks, like feeding your kids.
    ..before you respond to your wife, you apply a conditional output filter.
    ..your life looks like:

    Reply to this

      Excellent-Functionality

      Mar 13, 2015 at 04:22 PM

      you are writing tax documents in xPDO > .csv

      Reply to this

        Excellent-Functionality

        Mar 13, 2015 at 04:23 PM

        ...over a glass of red wine and walnut glazed roast pork, you romantically discuss your progress in MODx with your fiancée, and she nods and cheers, and sips, and nods, and listens attentively.

        Excellent-Functionality

        Mar 13, 2015 at 10:26 PM


        !Quip?
        &threaded=`1`
        &closeAfter=`0`
        &replyResourceId=`752`
        &useCss=`0`
        &maxDepth=`2`

      Excellent-Functionality

      Mar 13, 2015 at 09:26 PM

      Lo and behold, I say unto you, we shall all be changed, in the twinkling of a code at the last modx3 call. For modx3 will come forth and the sites will be raised imperishable.

      Reply to this

    Excellent-Functionality

    Mar 13, 2015 at 10:27 PM

    You get so caught up developing a new MODX powered website, you forget to go to bed (and then after having breakfast you go back to MODX vs bed).

    Reply to this

    Thijs Van Damme

    Sep 29, 2015 at 11:41 AM

    Testing

    Reply to this

    articles.more_articles

    Oct 28, 2015 at 05:08 AM

    dsfsdf wsfdwerd wew ee

    Reply to this

      Treigh

      Dec 02, 2015 at 11:39 AM

      This is looking good @donshakespeare!

      Reply to this

    Администратор

    Apr 12, 2017 at 05:46 AM

    sffsfsf

    Reply to this

POST YOUR COMMENT





Please wrap your code with <pre class='prettyprint linenums'></pre>
Or just click the html tags above