Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-06-05 13:54:56

keoshi
Member
From: Portugal
Registered: 2006-04-30
Posts: 53

Removing 'Message' field from comment form

Hey,

This may sound a bit silly but I’m trying to develop a site from TP and for one section of the site I don’t have to have the ‘message’ field in the comments form. I want people to submit name, email and url so the output is a name with the link on it.

So – I want to know if these two things are possible:

1 – Have two comment.php files (one for this section and another one for normal blogging commenting)

2 – Have two comment forms (which I’ve done but don’t know how to call the second one)

By the way, I’ve looked inside comment.php and tried to change it but I was unseccessful.

Any help would be welcome, thanks!

Offline

#2 2006-06-06 23:53:16

keoshi
Member
From: Portugal
Registered: 2006-04-30
Posts: 53

Re: Removing 'Message' field from comment form

bump

Offline

#3 2006-06-07 01:02:21

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Removing 'Message' field from comment form

Turn off auto_prepend comments in preferences, then you can call the comments form directly (more info). Just remove the message textarea, an you’re good to go. You might want to disable the preview option then — I think there’s a tutorial at textpattern.org.

Offline

#4 2006-06-07 01:08:18

keoshi
Member
From: Portugal
Registered: 2006-04-30
Posts: 53

Re: Removing 'Message' field from comment form

deldindesign: I’ve seen that tutorial and the information you gave me is all I needed, thanks a bunch! I’ll try it out later! ;)

Offline

#5 2006-06-10 00:27:59

keoshi
Member
From: Portugal
Registered: 2006-04-30
Posts: 53

Re: Removing 'Message' field from comment form

Sorry to bring this up again. This doesn’t work, it shows:

/site/blog/first-post#cpreview” id=“txpCommentInputForm”>

on the top of the comment form.
Is there any way to remove the message fields from at least one comment form?

Thanks to all, cheers!

Offline

#6 2006-06-10 01:25:17

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Removing 'Message' field from comment form

1. Go to admin prefs, and turn comment auto-append off. Go to the advanced prefs and make sure that you are not requiring the message field to be filled in.

2. Make a copy of “comments_form” and “comments_display”.

The originals will be used for your normal blogging commenting, and the copies will be for this section. What the forms are named doesn’t matter, whatever works for you. I’ll give them the names “no_message_form” and “no_message_display” here, so we don’t get anything confused.

3. Now we modify your form copies to remove the message field.

Open up “no_message_form” and edit it to remove the message field and it’s label. The piece to remove should look like:

<tr>
	<td valign="top" align="right">
		<label for="message"><txp:text item="message" /></label>
	</td>

	<td valign="top" colspan="2">
		<txp:comment_message_input />
	</td>
</tr>

Replace it with:

<input type="hidden" name="message" value="---" /><!-- plugin-place-holder -->

4. Open up “no_message_display”. Where it says <txp:comments_form />, you’re going to add to it the form parameter, and point it at “no_message_form”:

<txp:comments_form form="no_message_form" />

5. In the page for this section, underneath your call to the article tag, you’re going to add:

<txp:if_individual_article>
	<txp:article form="no_comments_display" />
</txp:if_individual_article>

6. In the page for your normal blogging section, underneath your call to the article tag, you’re going to add:

<txp:if_individual_article>
	<txp:article form="comments_display" />
</txp:if_individual_article>

All done.

Last edited by Mary (2006-06-10 21:26:38)

Offline

#7 2006-06-10 03:02:06

keoshi
Member
From: Portugal
Registered: 2006-04-30
Posts: 53

Re: Removing 'Message' field from comment form

Mary, thanks for your great reply.

I see now what I was missing: not require message on comments. Unfortunately, I do not have this option, just name and email.
I’m confused…

I’m running the last stable version, 4.0.3

Offline

#8 2006-06-10 03:20:37

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Removing 'Message' field from comment form

Oh shoot… I think maybe it is forced anyway (requiring comment messages)… yeah it is, just checked the file. Sorry ‘bout that.

Offline

#9 2006-06-10 03:22:46

keoshi
Member
From: Portugal
Registered: 2006-04-30
Posts: 53

Re: Removing 'Message' field from comment form

So, there’s no way, right? :(

Offline

#10 2006-06-10 03:23:16

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Removing 'Message' field from comment form

Okay, what if you add to your comment form:
<input type="hidden" name="message" value="---" />

Off the top of my head, that should satisfy Textpattern that a message has been entered, when in fact, it hasn’t.

Offline

#11 2006-06-10 03:27:33

keoshi
Member
From: Portugal
Registered: 2006-04-30
Posts: 53

Re: Removing 'Message' field from comment form

I thought about that method but it stills gives me the “/site/blog/first-post#cpreview” id=“txpCommentInputForm”>” and the un-clickable preview button…

Offline

#12 2006-06-10 03:33:07

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Removing 'Message' field from comment form

Please post exactly what you have for your comment_form form.

Offline

Board footer

Powered by FluxBB