Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-09-25 06:55:49
- cpk
- Member
- Registered: 2005-08-07
- Posts: 62
comments won't take class or id
This may actually belong in the presentation section but here goes…
I am trying to customize my comments forms (not the actual input forms but the txp presentation forms) and want to insert a class attribute for each of the comment divs. According to the TxP wiki, this can be done easily by placing the attribute into the <txp:comments class="myclass" /> form.
Problem is that once I insert the class attribute and review the source code of the updated page in which the comments appear, all I see are plain div tags surrounding each of the comments.
Am I doing this wrong or is my TxP installation misbehaving?
I am running TxP 4.0.3 with the comments NOT displayed as a numbered list.
Thanks,
cpk
Offline
Re: comments won't take class or id
You need to apply the class to the comments themselves, which isn’t controlled by <txp:comments />. Presentation>Forms>comments. The comments form represents an individual comment. Add your classes and other styles to that form, including the <div> and </div>. Then, change <txp:comments /> to <txp:comments break="" wraptag="" />.
Offline
#3 2006-09-25 18:44:45
- cpk
- Member
- Registered: 2005-08-07
- Posts: 62
Re: comments won't take class or id
I am a bit confused. I currently have no divs applied in either the <txp:comments_display />, <txp:comments_form />, or <txp:comments /> TxP presentation forms but when I look at the source code of my page, each of the comments is wrapped in a plain div tag with no id or class applied.
When I attempt to modify the <txp:comments /> form by adding a div, with the desired class, I get new div applied to each individual comment with whatever class attribute I have specified but it’s nested within the automatically generated div for each comment.
I can’t seem to get at the generic div that appears to be automatically generated by TxP to add a class attribute.
cpk
Offline
Re: comments won't take class or id
The div is added when you turn “Wrap comments in a list” off in the Admin>Prefs tab. That’s why you use <txp:comments break="" wraptag="" /> in the form, comments_display.
Offline
#5 2006-09-26 01:32:10
- cpk
- Member
- Registered: 2005-08-07
- Posts: 62
Re: comments won't take class or id
Thanks jm!
With your help I got it working.
I think I finally get it now. ;-)
cpk
Offline
Pages: 1