Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2009-12-24 23:38:40
- TWD
- Member
- Registered: 2009-09-10
- Posts: 14
Style the site owner's comments?
Hi! So I wanted to add a class to the containing div of the author’s comments, but my way won’t work.
I know this topic was sort of addressed here, but I’m trying a different route and I’m not sure why it’s not working. This is from the comments form. If I use this, no comments will show up, and I’m pretty sure it’s due to the if_variable
—without it, things work fine, even if I leave <txp:variable />
in there.
<txp:variable name="author_email" value='<txp:comment_email />' />
<txp:if_variable name="author_email" value="jane@doe.com">
<txp:cha_indenting_div class="comment jane">
<txp:else />
<txp:cha_indenting_div class="comment">
</txp:if_variable>
...gravatar, comment message, etc...
Offline
Re: Style the site owner's comments?
Take a look at the gva_commentclass plugin.
Offline
#3 2009-12-26 16:22:02
- TWD
- Member
- Registered: 2009-09-10
- Posts: 14
Re: Style the site owner's comments?
Thanks, that looks just about right. :) I know it’s possible without a plugin, though, so I’d like to see if this can be figured out still.
Offline
Re: Style the site owner's comments?
TWD wrote:
Thanks, that looks just about right. :) I know it’s possible without a plugin, though, so I’d like to see if this can be figured out still.
You can not nest container’s opening and closing tags inside another blocks. Neither TXP’s parser or PHP supports it.
Instead using:
<txp:if_>
<txp:container>
<txp:else />
<txp:container>
</txp:if_>
</txp:container>
You need:
<txp:if_>
<txp:container>
</txp:container>
<txp:else />
<txp:container>
</txp:container>
</txp:if_>
Offline
#5 2009-12-28 17:57:26
- TWD
- Member
- Registered: 2009-09-10
- Posts: 14
Re: Style the site owner's comments?
Thanks! I’ve got it working now. :)
Offline
Pages: 1