Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-10-18 20:58:13
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Reliable way to style comment preview "comments" form output
I’m curious, is there any way to reliably add a class to the actual output of the “comments” form? (I don’t mean comment_form, I mean the txp template form named “comments”)
Reason being, if_comments_preview
evaluates to true for every comment thru the comments output cycle, so every comment ends up getting the class or id applied. The only really reliable method I’ve found so far is to test if $thiscomment['dicussid']=='0'
, which only seems to occur for the previewed comment.
Any other tips?
Offline
#2 2006-10-19 17:46:10
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Reliable way to style comment preview "comments" form output
Sure.
<txp:if_comments>
<ol id="comments">
<txp:comments class="" wraptag="" break="" /><txp:comments_preview form="comment_preview" />
</ol>
</txp:if_comments>
:)
Last edited by Mary (2006-10-19 18:29:11)
Offline
#3 2006-10-19 17:57:00
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Re: Reliable way to style comment preview "comments" form output
So what you’re saying is that the last comment (the “previewed” comment, which doesn’t have a discussid) isn’t a TRUE case for if_comments
? Brilliant!
Offline
#4 2006-10-19 18:28:54
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Reliable way to style comment preview "comments" form output
Ooh. No. See updated code.
Offline
#5 2006-10-19 18:53:08
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Re: Reliable way to style comment preview "comments" form output
Ok, I’ll check it out. Thanks :)
Offline
#6 2006-10-19 19:37:54
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Re: Reliable way to style comment preview "comments" form output
Perfect. That’s the ticket. Thanks again, Mary.
Offline