Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-12-29 09:17:01

dada78
Member
From: New York
Registered: 2005-10-27
Posts: 138
Website

Extra Div Out Of Nowhere...

Hello all,
it appears as if TXP wraps a div and even an extra p tag around my comments.
I have looked over all my comment forms and my page template but there doesn’t seem to be a stray div anywhere??? —> here is the page

<strong>This is the critical part of what the browser source code displays:</strong>
<code>
<div><p>I enjoy your site very much.<br />
<a href=“http://example.com” title=“example.com”>Donald Swain</a>Jul 22, 02:11 PM</p></div>
<div><p><p>dfgdfgdfg</p><br />
<a href=“http://ertert” title=“ertert”>retert</a>Dec 23, 04:57 PM</p></div></code>

<strong>Each comment is wrapped in a div and even in an extra p tag.</strong>

<strong>This is how it should look:</strong>
<code>
<p>I enjoy your site very much.<br />
<a href=“http://example.com” title=“example.com”>Donald Swain</a>Jul 22, 02:11 PM</p>
<p>whatever text<br />
<a href=“http://ertert” title=“ertert”>retert</a>Dec 23, 04:57 PM</p>
</code>

Thanks everyone

Last edited by dada78 (2005-12-29 09:26:40)

Offline

#2 2005-12-29 10:15:44

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

Re: Extra Div Out Of Nowhere...

Comments are always presented as either an ordered list, or as a series of divs. This can chosen in preferences.

The p’s are probably a result of using textile on the comments. And a single comment can be several paragraphs.

Offline

#3 2005-12-29 17:44:33

dada78
Member
From: New York
Registered: 2005-10-27
Posts: 138
Website

Re: Extra Div Out Of Nowhere...

Hi Sencer,

I checked the preferences under my admin tab and I have “Present comments as a numbered list?” set to “no”.

Where would I turn the “wrap in div” feature off that you were mentioning?

Thank you!

Offline

#4 2005-12-29 18:06:17

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

Re: Extra Div Out Of Nowhere...

Where would I turn the “wrap in div” feature off that you were mentioning?

That’s not possible. It’s either/or.

I don’t see a reason against having that div there. Why would it bother anyone?

Offline

#5 2005-12-29 18:18:34

dada78
Member
From: New York
Registered: 2005-10-27
Posts: 138
Website

Re: Extra Div Out Of Nowhere...

Because the extra div tags and p tags are messing up the layout.

Would love to get rid of them…;-)

I will upgrade to the new version of TXP and see if anything changes…
Thanks

Offline

#6 2005-12-29 18:38:08

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

Re: Extra Div Out Of Nowhere...

I will upgrade to the new version of TXP and see if anything changes…

Plenty of reaons to update, but this is not one of them. ;)

Because the extra div tags and p tags are messing up the layout.

You are free to use CSS to style them anyway you like. If your layout looks funny, it’s probably because you haven’t styled them (or they are using too broadly defined other css-properties).

Would love to get rid of them…;-)

We can see in future versions whether it’s possible to control this, via attribues. I am not promising anything though. ;)

Offline

#7 2005-12-29 20:30:38

dada78
Member
From: New York
Registered: 2005-10-27
Posts: 138
Website

Re: Extra Div Out Of Nowhere...

Because the extra div tags and p tags are messing up the layout.

You are free to use CSS to style them anyway you like. If your layout looks funny, it’s probably because you haven’t styled them (or they are using too broadly defined other css-properties).

<strong>I indeed styled the comments and I tested my layout locally, which works perfectly, just not in TXP. I can see that the style that I defined for the comments is applied. The only thing that is bothersome are the div tags and p tags that are automatically added as I can’t find them in my forms anywhere. It’s probably something I am missing.</strong>

This is what I have in the page template:

<code>
<!— comments start —>
<div class=“comments”>
<txp:output_form form=“comments_display” />
</div>
<!— comments end —>
</code>
(Note: I also tried wrapping the comments_display form in the comments div but no change)

And in my comments_display form I have:
<code>
<h2>What Do You Think?</h2>
<p>* Required fields. <br />
Your e-mail address will not be published
on this site</p>
<txp:comments />
<txp:if_comments_allowed>
<txp:comments_form />
<txp:else />
<txp:text item=“comments_closed” />
</txp:if_comments_allowed>
</code>

<strong>So the result should be:</strong>
<code>
<div class=“comments”>
<h2><a href=”#”>What Do You Think? </a></h2>
<p>I enjoy your site very much.<br />
<a href=“http://example.com” title=“example.com”>Donald Swain</a>Jul 22, 02:11 PM</p>
<p>whatever text<br />
<a href=“http://ertert” title=“ertert”>retert</a>Dec 23, 04:57 PM</p>
<p>* Required fields. <br />
Your e-mail address will not be published
on this site</p>
<!— comment form start—>
<!— comment form end —>
</code>

<strong>Any clues how to accomplish this? I don’t recall having this trouble the last time I set something like this up.</strong>

Last edited by dada78 (2005-12-29 20:39:12)

Offline

#8 2005-12-29 20:38:51

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

Re: Extra Div Out Of Nowhere...

…p tags that are automatically added as I can’t find them in my forms anywhere…

The p’s are probably a result of using textile on the comments. And a single comment can be several paragraphs.

Offline

#9 2005-12-29 20:42:54

dada78
Member
From: New York
Registered: 2005-10-27
Posts: 138
Website

Re: Extra Div Out Of Nowhere...

The p’s are probably a result of using textile on the comments. And a single comment can be several paragraphs.

Hey Mary!

I am sorry to be so dense here, but what do you mean by “using textile on the comments”.
Is there an option to define if textile is used on comments or not?

Sorry if this is a stupid question? If there is a FAQ I’ll be glad to read over it.

Thanks a bunch!

Offline

#10 2005-12-29 20:43:06

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

Re: Extra Div Out Of Nowhere...

The only thing that is bothersome are the div tags and p tags that are automatically added as I can’t find them in my forms anywhere.

Yes, they are automatically added as I’ve explained above how, what, where and why.

What I am saying is: With the right CSS rules, it doesn’t make a difference whether those tags are there or not – because they can be made “invisible” in terms of layout (not html source code).

Offline

#11 2005-12-29 21:02:00

dada78
Member
From: New York
Registered: 2005-10-27
Posts: 138
Website

Re: Extra Div Out Of Nowhere...

What I am saying is: With the right CSS rules, it doesn’t make a difference whether those tags are there or not – because they can be made “invisible” in terms of layout (not html source code).

Yes, but how should I apply a class or id to a div that I don’t see anywhere in the forms…

I already applied the div class comments (see below) so I don’t understand what else I need to modify in order for the appended divs to behave?

<code>
<div class=“comments”>
<txp:output_form form=“comments_display” />
</div>
</code>

Wuahhhh… I need a beer…

Offline

#12 2005-12-29 21:23:37

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

Re: Extra Div Out Of Nowhere...

Err, I think I may have been a bit out of the loop. There is an easy way to do what you want:

Replace:
<txp:comments />

with
<txp:comments break="" wraptag="" />

I apologize for the confusion!

I don’t think you want to get rid of the p’s from textile, because it will mess up what the commenters wrote. Have you checked the form named “comments”, whether there is anything unwanted in there?

Offline

Board footer

Powered by FluxBB