Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-08-24 12:52:02

wornout
Member
From: Italy
Registered: 2009-01-20
Posts: 256
Website

Problems with comment preview

I have two columns layout. The left column contains comment form and the right column contains all comments.
All goes well until I select preview button. The preview appears in two places: one above comment form and one where I put comment preview tag.
In the faq I read that placing a comment preview tag will disable auto append. Maybe I’m wrong.

So, why I get double preview and how can solve that if it’s possible?
Many thanks!

Offline

#2 2010-08-24 17:18:41

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Problems with comment preview

wornout wrote:

In the faq I read that placing a comment preview tag will disable auto append.

I don’t think that is right, you still need to disable auto append in preferences. Edit: sorry, just found where you read that. I wasn’t aware of that, but you could still try if disabling the setting in preferences makes a difference.

If it doesn’t, what is the code you are using for the left and the right column?

Last edited by els (2010-08-24 17:24:41)

Offline

#3 2010-08-25 06:58:42

wornout
Member
From: Italy
Registered: 2009-01-20
Posts: 256
Website

Re: Problems with comment preview

Here’s the code I’ve used for comments:

<div>
<div id="left">
<txp:comments_form />
</div><!-- left -->
<div id="right">
<div id="comments-list">
<txp:if_comments_preview>
<div id="cpreview">
<txp:comments_preview />
</div><!-- cpreview -->
</txp:if_comments_preview>
<txp:comments />
</div><!-- comments-list -->
</div><!-- right -->
</div>

And the comment form:

<div id="form">
<div class="form-line">
<label for="name">Your name</label><br />
<txp:comment_name_input />
</div><!-- form-line -->
<div class="form-line">
<label for="textarea">Your message</label><br />
<txp:comment_message_input />
</div><!-- form-line -->
<div class="form-line" id="submit-line">
<txp:comment_preview />
<txp:comment_submit />
</div><!-- form-line -->
</div><!-- form -->
<txp:comments_error wraptag="ul" break="li" class="comment-errors" />

The preview that I like to hide appears above comment form.

Offline

#4 2010-08-25 08:44:06

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 345
Website

Re: Problems with comment preview

Here’s what I use when calling the form :

<txp:comments_form show_preview="0" />

Notice the attribute show_preview, that’s what makes disappear the preview above the form.

Offline

#5 2010-08-25 08:58:02

wornout
Member
From: Italy
Registered: 2009-01-20
Posts: 256
Website

Re: Problems with comment preview

From Textbook – Comments Form that attribute was removed in version 4.0.4 but it seems working…
Thanks

Offline

#6 2010-08-25 10:42:37

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Problems with comment preview

I think the answer to your problem is simple – you are placing a <txp:comments_form /> tag in your left div which calls the comments_form by default unless you explicitly add a form="some_other_form" attribute. Inside the comment_form you will see that the comments_preview tag is already inside that form.

On the right div, you have another comments_preview tag, hence the repeated preview.

Offline

#7 2010-08-25 11:03:02

wornout
Member
From: Italy
Registered: 2009-01-20
Posts: 256
Website

Re: Problems with comment preview

I modified the default comment form with my code.
I also have try to create a new form and call it but the same duplicate preview appears.
At now <txp:comments_form show_preview="0" /> works. Maybe this attribute was reintegrated…

Offline

Board footer

Powered by FluxBB