Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-08-18 21:10:49

nabrown78
Member
From: Northampton, MA, USA
Registered: 2006-10-04
Posts: 294
Website

Does txp:if_comments_error only work within comments form?

I am using the following code:

<txp:if_comments_error>
  <txp:comments_error break="li" wraptag="ul" />
</txp:if_comments_error>

To output comment errors. I’d like to mix things up a bit and put the errors within my comment preview, as well as making a special note there that is output only if there are errors, but the only place I can get the errors to display are within the comment form.

Will error comments only be output when a call to <txp:comments_form /> is made? If so, is there a workaround?

Offline

#2 2009-08-18 21:42:24

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

Re: Does txp:if_comments_error only work within comments form?

Yes, I think it can only be used inside a comments form. But wouldn’t it work to use a second form to display the errors?

<txp:comments_form form="error_form" />

‘error_form’:

<txp:if_comments_error>
  <txp:comments_error break="li" wraptag="ul" />
</txp:if_comments_error>

Offline

#3 2009-08-19 07:36:59

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

Re: Does txp:if_comments_error only work within comments form?

Hi Nora, not sure if you want something like I have on my personal site. Check this link and preview a comment. I have the error checking next to the comments form.

Offline

#4 2009-08-19 14:19:23

nabrown78
Member
From: Northampton, MA, USA
Registered: 2006-10-04
Posts: 294
Website

Re: Does txp:if_comments_error only work within comments form?

@jstubbs – That’s a good looking comment form, and user-friendly.

What I’d really like to do is insert some language into the preview area if there are comment errors. Instead of just saying “click submit to post your comment” for example, it might say “After fixing the following errors, click submit to post your comment.

Offline

Board footer

Powered by FluxBB