We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39131
    • 84 Posts
    designcouch - Works great now, especially with the JQuery Collapse.

    Thanks for your help.

    Joost
      • 37984
      • 215 Posts
      Glad I could help!
        Jesse Couch
        MODX Aficionado, Front-End Designer & Developer
        http://www.designcouch.com
        • 37984
        • 215 Posts
        Been asked to post the custom &tplAddComment chunk I used in my solution, and I think that's a really good idea. Here you go, everyone:

        [[+successMsg:eq=``:then=``:else=`
        
        <div style="position:fixed;left:0;right:0;top:0;bottom:0;background:rgba(255,255,255,.5);z-index:9000;">
        
        <div style="width:50%;margin:10% auto 0 auto;"><h1>[[+successMsg]]</h1><p><a href="[[+url]]">Head back to the thread</a></p></div>
        
        </div>
        `]]
        
        <form style="padding-top:1.8em;" id="quip-add-comment-[[+idprefix]][[+parent]]" action="[[+url]]#quip-comment-preview-box-[[+idprefix]]" method="post" class="comment_form">
        <div class="quip-comment quip-add-comment">
            <input type="hidden" name="nospam" value="" />
            <input type="hidden" name="thread" value="[[+thread]]" />
            <input type="hidden" name="parent" value="[[+parent]]" />
            <input type="hidden" name="auth_nonce" value="[[+auth_nonce]]" />
            <input type="hidden" name="preview_mode" value="[[+preview_mode]]" />
        
            <div class="quip-fld">
        	 	<p class="quip-error">[[+error.name]]</p>
                <label for="quip-comment-name-[[+idprefix]]">[[%quip.name? &namespace=`quip` &topic=`default`]]:</label>
                <input type="text" name="name" id="quip-comment-name-[[+idprefix]]" class="required" value="" placeholder="Name" />
        		<span style="color:red;position:absolute;padding:1em;z-index:6;top:0;right:0;">*</span>
            </div>
            
            <div class="quip-fld">
        		<p class="quip-error">[[+error.email]]</p>
                <label for="quip-comment-email-[[+idprefix]]">[[%quip.email]]:</label>
                <input type="text" name="email" id="quip-comment-email-[[+idprefix]]" class="required email" value="" placeholder="Email" />
        		<span style="color:red;position:absolute;padding:1em;z-index:6;top:0;right:0;">*</span>
            </div>
            
            <div class="quip-fld">
        		<p class="quip-error">[[+error.website]]</p>
                <label for="quip-comment-website-[[+idprefix]]">[[%quip.website]]:</label>
                <input type="text" name="website" id="quip-comment-website-[[+idprefix]]" class="url" value="" placeholder="Website" />
            </div>
        
            <div class="quip-fld">
                [[+unsubscribe:default=`
        		<p class="quip-error">[[+error.notify]]</p>
                <input type="checkbox" value="1" name="notify" id="quip-comment-notify-[[+idprefix]]" [[+notifyChecked]] />
        		<label for="quip-comment-notify-[[+idprefix]]">[[%quip.notify_me]]:</label>
                `]]
        		Notify me of new replies
            </div>
        
            <div class="quip-fld recaptcha">
            [[+quip.recaptcha_html]]
            <span class="quip-error">[[+error.recaptcha]]</span>
            </div>
            
            
            <p><span class="quip-allowed-tags">[[%quip.allowed_tags? &tags=`[[++quip.allowed_tags:htmlent]]`]]</span><span class="quip-error">[[+error.comment]]</span></p>
        	<div class="quip-fld">
            <textarea name="comment" id="quip-comment-box-[[+idprefix]]" placeholder="Comment" class="required" rows="5">[[+comment]]</textarea>
        	<span style="color:red;position:absolute;padding:1em;z-index:6;top:0;right:0;">*</span>
        	</div>
            
            [[+can_post:is=`1`:then=`<button type="submit" class="submit button_disabled" name="[[+post_action]]" value="1" disabled="disabled">[[%quip.post]]</button>`]]
        
            <br class="clear" />
        </div>
        
        <script>
        $(document).ready(function() {
           $('#quip-add-comment-[[+idprefix]][[+parent]]').bind('change keyup', function() {
            if($(this).validate().checkForm()) {
                $('#quip-add-comment-[[+idprefix]][[+parent]] :submit').removeClass('button_disabled').attr('disabled', false);
            } else {
                $('#quip-add-comment-[[+idprefix]][[+parent]] :submit').addClass('button_disabled').attr('disabled', true);
            }
        });
        });
        </script>
        </form>


        I realize it's quite extensive, and there's a lot of stuff that is specific to my particular site; however, it may give some more ideas as to how to pull off this particular functionality. Good luck!
          Jesse Couch
          MODX Aficionado, Front-End Designer & Developer
          http://www.designcouch.com
          • 37099
          • 338 Posts
          Thanks for that Jesse, but having struggled with it for a couple of days I still can't get it to work.

          Are you sure that's the chunk you are using? As when I look at the source code for http://www.designcouch.com/home/why/2013/03/17/where-is-apples-mobile-site/

          I see this code before the drop down reply form:

              <div class="quip-comment-options">
                  
                  
              </div>
              <div class="quip-break"></div>
          
          	<script>
          	new jQueryCollapse($("#49_comment_box"), {
                    open: function() {
                      this.slideDown(150);
                    },
                    close: function() {
                      this.slideUp(150);
                    }
                  });
          	</script>
          
          	<div id="#49_comment_box" class="comment_box" data-collapse>
          
          	<h2>Reply</h2>
          		<div>


          Or is that from another chunk?

          Thanks
          Mike
            • 37984
            • 215 Posts
            Mike,

            It is indeed from another chunk. Inspecting the code on your site, your jQueryCollapse script is targeting a div that does not exist. The div enclosing your comment form needs to have an id that includes the comment ID number followed by the "_comment_box" suffix. Here's my custom comment chunk:

            <li class="[[+cls]]" id="[[+idprefix]][[+id]]" [[+depth_margin:notempty=`style="padding-left: [[+depth_margin]]px"`]]>
            <div id="[[+idprefix]][[+id]]-div" class="quip-comment-body [[+alt]]">
            
                <div class="gravatar">
                    [[+gravatarUrl:notempty=`<img src="[[+gravatarUrl]]" class="quip-avatar" alt="[[+authorName:striptags]]" />`]]
                </div>
            
            	<h2 style="padding-top:0;padding-bottom:1em;" class="quip-comment-author">[[+authorName]]</h2>
            
            	<p><span class="posted_date">[[+createdon]]</span><br/>[[+body]]</p>
            
            	<div [[+replyUrl:notempty=`style="margin-bottom:-25px;position:relative;z-index:500;width:50%;"`]] class="like_dislike">[[!LikeDislike? &tpl=`mini_likedislik` &name=`like_dislike[[+id]]` ]]</div>
            
                <div class="quip-comment-options">
                    [[+report]]
                    [[+options]]
                </div>
                <div class="quip-break"></div>
            
            	<script>
            	new jQueryCollapse($("#[[+id]]_comment_box"), {
                      open: function() {
                        this.slideDown(150);
                      },
                      close: function() {
                        this.slideUp(150);
                      }
                    });
            	</script>
            
            	[[+replyUrl:notempty=`<div id="#[[+id]]_comment_box" class="comment_box" data-collapse>
            
            	<h2>Reply</h2>
            		<div>[[!QuipReply? &thread=`[[+thread]]` &tplAddComment=`quipAddCommentCustom2` &parent=`[[+id]]` &closeAfter=`0` ]]</div>
            	</div>`]]
            </div>
                [[+children:notempty=`<ol class="quip-comment-list">[[+children]]</ol>`]]
            </li>


            Hope this helps.
              Jesse Couch
              MODX Aficionado, Front-End Designer & Developer
              http://www.designcouch.com
              • 37099
              • 338 Posts
              Hi Jesse,

              Thanks very much for your help.

              I've found out what was wrong with my attempt, I was missing the transition CSS:

              .comment_box > h2.close + div {
                  display: block !important;
                  max-height: 0;
                  overflow: hidden;
              }
              * {
                  transition: all 0.25s ease-in-out 0s;
              }


              But I think you have some redundant code in your example.

              You have
              [[+replyUrl:notempty=`<div id="#[[+id]]_comment_box"


              You have that # starting the id that shouldn't be there

              It means
              new jQueryCollapse($("#[[+id]]_comment_box").. 
              won't work.

              But that doesn't matter because you have put in the "data-collapse" attribute on the comment container which is an alternative to the jQuery, so you page still works.

              Thanks again for posting up your snippets, and showing us how to do nice threaded comments.

              Cheers
              Mike
                • 37984
                • 215 Posts
                Thanks for catching that - my site was actually designed and coded in about a week and a half, and I haven't had a chance to go back and clean up the code; that's my lot in life right now, as I've been very busy with client sites (I think all designers can identify; your personal work takes a back seat to paying work, always). I'll put that on my list of things to clean up smiley
                  Jesse Couch
                  MODX Aficionado, Front-End Designer & Developer
                  http://www.designcouch.com
                  • 36426
                  • 197 Posts
                  Hi I hope you can help - I'm really impressed by this quip implementation with out having to go off to other pages etc, but I'd hope you may be able to step me through setting this up.

                  I've installed quip and I've made two chunks one called quipAddCommentCustom and one quipAddCommentCustom2.

                  and I've added this to my template code:

                  [[!Quip? &thread=`[[+thread]]` &threading=`1`]]
                  <br />
                  [[!QuipReply? &thread=`[[+thread]]` &tplAddComment=`quipAddCommentCustom` &parent=`[[+id]]` ]]


                  I just wondered where I go from here. I assume I need to include jQueryCollapse somewhere in the template and create some TVs such as thread?

                  Any help with my setup would be really appreciated as I haven't used Quip before and am just trying to piece together your posts from this thread.

                  Thanks again.
                    Yorkshire UK based hosting provider: https://www.simulant.uk
                    • 42562
                    • 1,145 Posts
                    Quote from: jonahnaylor at Oct 22, 2014, 02:25 PM
                    I assume I need to... create some TVs such as thread?
                    No need to create anything.

                    Supply the name manually, yourself; give a unique name
                    [[!Quip? &thread=`myBlog-[[*id]]` &threading=`1`]]
                    <br />
                    [[!QuipReply? &thread=`myBlog-[[*id]]` &tplAddComment=`quipAddCommentCustom` &parent=`[[+id]]` ]]
                    


                    Here is a tutorial on how to implement this, enjoy.
                    http://www.leofec.com/modx-revolution/using-only-one-form-in-modx-quip-comments.html
                      TinymceWrapper: Complete back/frontend content solution.
                      Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                      5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                      • 8168
                      • 1,118 Posts
                      Quote from: designcouch at Mar 25, 2013, 01:25 PM
                      Glad I could help!

                      Hiya - I am looking at implementing something very similar myself and have the reply page loading in a modal nicely - problem is with reference the inline validation of the form fields... if the user forgets to add in details to a field, the page is refreshed and loads the Page Reply in its own window and therefore the modal approach is compromised... Any ideas on a fix?

                      Cheers,

                      dubbs.