On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • hi have created two bits of code and both work in essence

    ViewComment chuck

    				<ul>
    					<li>
    						<a href="#"><img src="assets/templates/positive/css/images/avatar.jpg" alt="" class="avatar" /></a>
    						<section class="top">
    							<p><a href="#" class="reply">Reply</a> <span class="right"><a href="[[+url]]">[[+createdon]]</a></span> <a href="#" class="username">[[+authorName]]:</a>[[+approved:if=`[[+approved]]`:is=`1`:then=``:else=`- <em>[[%quip.unapproved? &namespace=`quip` &topic=`default`]]</em>`]]</p>
    						</section>
    						<div class="quip-comment-text">
            <p>[[+body]]</p>
    
            [[+replyUrl:notempty=`<p><span class="quip-reply-link"><a href="[[+replyUrl]]">[[%quip.reply? &namespace=`quip` &topic=`default`]]</a></span></p>`]]
        </div>
    
        <div class="quip-comment-options">
            [[+report]]
            [[+options]]
        </div>
        <div></div>
    </div>
        [[+children:notempty=`<ol class="quip-comment-list">[[+children]]</ol>`]]
    					</li>
    <li>[[+preview]]</li>
    				</ul>	
    			</section>


    AddComment Chunk

    <span class="quip-success" id="quip-success-[[+idprefix]]">[[+successMsg]]</span>
    			<form action="[[+url]]#quip-comment-preview-box-[[+idprefix]]" method="post" id="comment-form">
    				<h4>Leave Comment</h4>
    
    				<label for="name-field">[[%quip.name? &namespace=`quip` &topic=`default`]]:<span class="quip-error">[[+error.name]]</span></label>
    				<input type="text" class="field" value="" id="name-field" />
    
    				<label for="email-field">[[%quip.email]]:<span class="quip-error">[[+error.email]]</label>
    				<input type="text" class="field" value="" id="email-field" />
    				
    				    <div class="quip-fld">
    						<label for="quip-comment-notify-[[+idprefix]]">[[%quip.notify_me]]:<span class="quip-error">[[+error.notify]]</span></label>
    						<input type="checkbox" value="1" name="notify" id="quip-comment-notify-[[+idprefix]]" [[+notify:if=`[[+notify]]`:eq=`1`:then=`checked="checked"`]] />
    					<br />
    				</div>
    
    				<label for="message-field">Comment :</label>
    				<textarea class="field" id="message-field">[[+comment]]</textarea>
    				<script type="text/javascript">
             function showRecaptcha(element) {
               Recaptcha.create("your_public_key", element, {
                 theme: "blackglass",
                 callback: Recaptcha.focus_response_field});
             }
          </script>
    
    				
    				<button type="submit" name="[[+preview_action]]" value="1">[[%quip.preview]]</button>
        [[+can_post:is=`1`:then=`<button type="submit" name="[[+post_action]]" value="1">[[%quip.post]]</button>`]]
    				
    			</form>
    			<span class="quip-success" id="quip-success-[[+idprefix]]">[[+successMsg]]</span>


    my problem is it wont post or preview once I click the button

    my calls to these chunks are

    <section id="comments">
    				<h4><a href="#" class="reply">Comments</h4>
    				
    			[[!Quip? &thread=`blog-post-[[*id]]` &tplComment=`ViewComment` &threaded=`0`]]
    				
    			</section>
    
    				[[!QuipReply? &thread=`blog-post-[[*id]]` &recaptcha=`1` &tplAddComment=`AddComment`]]


    all help appreciated
    • Isn't it that your buttons should have the ID set to [[+preview_action]]/[[+post_action]]? Right now you have only got the name attribute set.
      • Not sure, I will try it but I don't think it is that as the code for the button is pulled straight from a working model.

        But thanks for the insight
        • In your AddComment chunk you are missing all the hidden fields. I thought the form checked for the ID of the buttons, but name seems to be fine. Take a look at the original chunk (you can find it in core/components/quip/elements/chunks) and compare it to yours. Like I said: try adding the hidden fields.

          Good luck.

          PS: why use a static avatar? It's possible to use a default image.
          • You my friend are a bloody star

            The site doesn't have members nor am I sure I want any so I went with a static one that I can keep the theme of my site clean as it will mainly be used as on e-portfolio the comment thread is just something I am toying with to aid discussion on topics for my university course.

            I may drop it in favour of a mini forum ...I'm undecided.