Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-05-13 14:02:08

Ferio
Member
From: Madrid, Spain, Europe
Registered: 2006-05-13
Posts: 19
Website

How do I change comments form code?

Hi, I’m using TextPattern at http://www.tecniferio.com; it’s a XHTML 1.1-compliant webpage (I’m not using content negotiation, it’s been served as application/xhtml+xml, with all its consequences), but when I try to validate any comments page, I got 2 errors because there’s an input element called “backpage” which is not inside a XHTML block element (which is not possible when using XHTML 1.1), and I was wondering if anybody could tell me where I can find the code that produces the output in which I should add this element, in order for my whole page to be XHTML 1.1-compliant. Thank you in advance!

Offline

#2 2006-05-13 15:57:19

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,122
Website GitHub Mastodon Twitter

Re: How do I change comments form code?

The problem i see is that you have <code></table></code> but no <code><table></code>


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2006-05-13 16:19:13

Ferio
Member
From: Madrid, Spain, Europe
Registered: 2006-05-13
Posts: 19
Website

Re: How do I change comments form code?

Oh, no, it’s in there; if you use W3C validator and looking at <a href=“http://validator.w3.org/check?uri=http%3A%2F%2Fwww.tecniferio.com%2F2006%2F05%2F12%2Fdocumentales&charset=%28detect+automatically%29&doctype=Inline&ss=1&outline=1&sp=1&No200=1&verbose=1”>my latest entry comment page validation</a>, it’s in line 430, just after the form opening tag. All I need to know is where this output is generated to add a block element. At least, I think this is what I need…

Offline

#4 2006-05-13 17:41:29

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,122
Website GitHub Mastodon Twitter

Re: How do I change comments form code?

OK… it is there:) I’ve missed it before
I’m looking at : http://www.tecniferio.com/2006/05/12/documentales
Did you try to reposition
<code><input type=“hidden” name=“parentid” value=“16” /><input type=“hidden” name=“backpage” value=”/2006/05/12/documentales” /></code> within the table?

>Edit… I have checked it in validator. If you move the above within the table all is ok

Last edited by colak (2006-05-13 17:59:23)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2006-05-13 22:05:34

Ferio
Member
From: Madrid, Spain, Europe
Registered: 2006-05-13
Posts: 19
Website

Re: How do I change comments form code?

OK, we know now about what the problem is, but I’ve got no idea on how to solve it (I’m still learning about all these things). My TXP comments form looks like this:
<code>
<txp:comments_error /> <table cellpadding=“4” cellspacing=“0” border=“0”> <tr> <td align=“right” valign=“top”> <label for=“name”><txp:text item=“name” /></label> </td> <td valign=“top”> <txp:comment_name_input /> </td> <td valign=“top” align=“left”> <txp:comment_remember /> </td> </tr> <tr> <td align=“right” valign=“top”> <label for=“email”><txp:text item=“email” /></label> </td> <td valign=“top” colspan=“2”> <txp:comment_email_input /> </td> </tr> <tr> <td align=“right” valign=“top”> <label for=“web”>http://</label> </td> <td valign=“top” colspan=“2”> <txp:comment_web_input /> </td> </tr> <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> <tr> <td align=“right” valign=“top”>&nbsp;</td> <td valign=“top” align=“left”> <txp:comments_help /> </td> <td align=“right” valign=“top”> <txp:comment_preview /> <txp:comment_submit /> </td> </tr> </table>
</code>
<br/>
So, I still dunno where this 2 input elements come from, and I don’t know how to fix it :S Shouldn’t I edit some TXP .php file in order for this output to be properly displayed?

Last edited by Ferio (2006-05-13 22:06:09)

Offline

#6 2006-05-14 07:14:37

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,122
Website GitHub Mastodon Twitter

Re: How do I change comments form code?

the lines generated are the ones which tell the comment form what article the comment is relating with.

It is too early in the morning for me and I cannot see how to solve it but this is what I have in one of my sites and it works ok…

<code><txp:comments_error />
<fieldset>
<div class=“leftc”><label for=“message”><txp:text item=“message” /></label></div>
<div class=“rightc”><label class=“rig”><txp:comment_message_input /></label></div>
<div class=“leftc”><label class=“nnn”><txp:text item=“name” /></label></div>
<div class=“rightc”><label class=“nnn”><txp:comment_name_input /></label></div>
<div class=“leftc”><label class=“rig”><txp:text item=“email” /></label></div>
<div class=“rightc”><label class=“rig”><txp:comment_email_input /></label></div>
<div class=“leftc”><label class=“nnn”>http://</label></div>
<div class=“rightc”><label class=“nnn”><txp:comment_web_input /></label><txp:comment_remember /></div><div class=“i”>
<txp:comments_help />
<label class=“nnn”><txp:comment_preview /></label>
<label class=“nnn”><txp:comment_submit /></label>
</div>
</fieldset></code>

It uses divs as opposed to tables and it is 504 compliant too.

Last edited by colak (2006-05-14 07:19:37)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#7 2006-05-14 08:17:09

Ferio
Member
From: Madrid, Spain, Europe
Registered: 2006-05-13
Posts: 19
Website

Re: How do I change comments form code?

I’ve tried to use your piece of code and I’m getting the same problem, it keeps asking about this input elements that appear after your closing fieldset tag… My deduction, being too early in the morning for me too ;), is that TXP is adding these elements every time a comment is sent, no matter what the form code is, so I’d should look where this output is created and try to change it. I have no idea on PHP, but I’ll try.

Offline

#8 2006-05-14 08:54:54

Ferio
Member
From: Madrid, Spain, Europe
Registered: 2006-05-13
Posts: 19
Website

Re: How do I change comments form code?

I’ve been taking a look at some files, and I’ve found a function called commentForm int /textpattern/publish/comment.php (lines 59-182); I think my problem is in there, beginning in line 167; it’s the first time I see such a complicated PHP code, but I understand the most of it (or so I think). Anyway, if anybody could help me to spot what’s annoying me, he’ll be welcomed.

Offline

#9 2006-05-14 09:35:32

Ferio
Member
From: Madrid, Spain, Europe
Registered: 2006-05-13
Posts: 19
Website

Re: How do I change comments form code?

Wow, I’ve got it; the solution was changing some code in this file I said before; now it looks like this (lines 167-176):

<code> $out .= $form; $out .= ‘<div>’; $out .= fInput(‘hidden’,‘parentid’,$parentid); $split = rand(1, 31); $out .= ($preview) ? hInput(substr($nonce, 0, $split),substr($nonce, $split)) : ‘’;

$out .= (!$preview) ? fInput(‘hidden’,‘backpage’,serverset(“REQUEST_URI”)) : fInput(‘hidden’,‘backpage’,$backpage); $out .= ‘</div>’;
</code>

I’ve just put a div element to contain the output of the functions that produced the input elements, and it seems to work like a charm. Thank you!

PS: the main idea for this solution has been taken from a thread that used to be in the Dead Letter Office section called <em>XHTML 1.1 validation — nearly there</em>. Anyway, it’s not there anymore, but Google cache made it for me ;)

Offline

#10 2006-05-14 10:02:09

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: How do I change comments form code?

Offline

#11 2006-05-14 21:00:11

Ferio
Member
From: Madrid, Spain, Europe
Registered: 2006-05-13
Posts: 19
Website

Re: How do I change comments form code?

Wow, I promise I look at them and I didn’t see it :S I’m sorry!

Offline

Board footer

Powered by FluxBB