Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-04-20 12:52:40

Freeant
Member
Registered: 2012-04-16
Posts: 36

Remove "Thanks for you comment"

After adding comments the form disappears, (name, email, comment), instead of it, the following inscription appears: Thanks for you comment

how to make a comment after adding the form itself has not disappeared.
and would not be inscription

ie, just wrote a comment and just might write another one.

Offline

#2 2012-04-20 14:14:58

alivato
Member
Registered: 2011-03-31
Posts: 151

Re: Remove "Thanks for you comment"

in textpattern\publish\taghandlers.php

find scribbles

$out = graf($out, ' id="txpCommentInputForm"')

replace it with a

$out = commentForm($thisid,$atts)

Offline

#3 2012-04-20 14:28:22

Freeant
Member
Registered: 2012-04-16
Posts: 36

Re: Remove "Thanks for you comment"

thx u alivato

My comments_display form:

<txp:comments wraptag="ol" break="li" />
<txp:comments_preview>
<div id="cpreview">
<txp:comments_preview />
</div>
</txp:comments_preview>
<txp:if_comments_allowed>
<txp:comments_form />
<txp:else />
<txp:if_comments>
<p class="comments_closed"><txp:text item="comments_closed" /></p>
</txp:if_comments>
</txp:if_comments_allowed>

How to change the position??

Last edited by Freeant (2012-04-20 14:28:50)

Offline

#4 2012-04-20 21:57:17

Freeant
Member
Registered: 2012-04-16
Posts: 36

Re: Remove "Thanks for you comment"

??

Offline

#5 2012-04-21 11:57:51

Freeant
Member
Registered: 2012-04-16
Posts: 36

Re: Remove "Thanks for you comment"

hi

How to make the first was a form (name, email …), and then preview and the comments themselves.

?

Offline

#6 2012-04-21 12:44:25

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: Remove "Thanks for you comment"

I wouldn’t say that I can help anyone through the jungle of TXPs comment tags, they’re overwhelming, IMO, when you’re not using them regularly. But I see at least one error in your code: txp:comments_preview used as a container tag, although it’s a single tag. So I assume you’re composing tags on your own instead of taking the easier approach and changing the existing comment forms until they suit your needs.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#7 2012-04-22 13:15:19

Freeant
Member
Registered: 2012-04-16
Posts: 36

Re: Remove "Thanks for you comment"

If you do so

<div class="label_com" id="<txp:text item="comment" />"><txp:comments_invite textonly="1" showalways="1" showcount="0" /></div>
<txp:if_comments_allowed>
<txp:comments_form isize="25" msgcols="45" msgrows="15" />
<txp:else />
<p><txp:text item="comments_closed" /></p>
</txp:if_comments_allowed>
<div id="cpreview">
<txp:comments_preview />
</div>
<txp:comments />

Everything seems fine.

But the “preview comment” is duplicated. Displayed above and below.???

Although, in theory, should only be a preview at the bottom.???

Last edited by Freeant (2012-04-23 10:05:20)

Offline

#8 2012-04-22 17:56:35

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: Remove "Thanks for you comment"

Freeant wrote:

Although, in theory, should only be a preview at the bottom.???

Yup! So there will be one too many of txp:comment_preview or txp:comment*s*_preview tags sitting in any of your other forms (depending on the google translation). Best way to find these (and for re-establishing tidiness after finishing your form work), is applying smd_where used, see link in my signature.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#9 2012-04-29 21:42:59

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,001
Website GitHub

Re: Remove "Thanks for you comment"

use the attritube show_preview="0" in txp:comments_form if you want to position your own comment preview:

<txp:comments_form isize="25" msgcols="45" msgrows="15" show_preview="0" />

TXP Builders – finely-crafted code, design and txp

Online

#10 2012-04-29 22:09:51

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,001
Website GitHub

Re: Remove "Thanks for you comment"

they’re overwhelming, IMO, when you’re not using them regularly

Too right Uli, if you don’t use these often, it’s hard to find one’s way through the comment forms.

As I’ve been fiddling with this today, here’s my take on a revised comment_form (which can probably be refined further):

page template:

<txp:if_comments>
   <txp:variable name="comment_count"><txp:comments_count /></txp:variable>
   <h3>Showing <txp:comments_count /> <txp:if_variable name="comment_count" value="1">comment<txp:else/>comments</txp:if_variable>:</h3>
   <txp:comments form="blog_comment" break="" />
</txp:if_comments>

<txp:if_comments_allowed>
   <h3>Leave a comment</h3>
   <txp:comments_form isize="25" msgcols="45" msgrows="10" form="blog_comment_form" show_preview="0" />
<txp:else />
   <p class="commenting-closed">Commenting is closed for this post.</p>
</txp:if_comments_allowed>

and this is comment-form blog_comment_form:

<txp:if_comments_error>
   <div id="cpreview" class="comment-errors">
      <txp:comments_error wraptag="ul" break="li" />
   </div>
<txp:else />
   <txp:if_comments_preview>
      <div id="cpreview" class="comment-preview">
         <txp:comments_preview form="blog_comment" />
      </div>
   </txp:if_comments_preview>
</txp:if_comments_error>

       <fieldset>  
          <p>
            <label for="name">Name*</label>
            <txp:comment_name_input />
            <txp:comment_remember />
          </p> 
          <p>
            <label for="email">Email*</label>
            <txp:comment_email_input />
          </p> 
          <p>
            <label for="web">www</label>
            <txp:comment_web_input />
          </p> 
          <p>
            <label for="message">Your message*</label>
            <txp:comment_message_input />
          </p> 
          <div class="submit">

             <txp:if_comments_error>
               <txp:comment_preview />
             <txp:else />
               <txp:if_comments_preview>
                 <txp:comment_submit />
                 <div class="sub_btn"><txp:comment_preview /></div>
               <txp:else />
                 <txp:comment_preview />
               </txp:if_comments_preview>
             </txp:if_comments_error>

          </div> 
       </fieldset> 

Differences with this version:

  • Only shows you the preview button to begin with – no non-clickable submit button
  • Only shows you the submit button when there are no errors, i.e. when you can actually submit it. The preview button is still there but shifts over and is wrapped in a div so it can be styled differently.
  • The preview only shows once there are no errors.
  • txp:comment_form’s form action always auto-scrolls to #cpreview on page reload. In this version, it scrolls to either the errors or the preview. You can style them differently via an additional class.
  • The preview uses the same comment display form as the comments themselves (in this case a custom one) – txp:comment_preview will accept a form attribute, but it is (currently) undocumented.

TXP Builders – finely-crafted code, design and txp

Online

#11 2012-04-30 15:13:11

Freeant
Member
Registered: 2012-04-16
Posts: 36

Re: Remove "Thanks for you comment"

thx alivato & jakob & uli

Last edited by Freeant (2012-04-30 21:30:53)

Offline

Board footer

Powered by FluxBB