Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Style the comments_closed paragraph?
Here’s what I want to do: Put a class on the <p> tag that contains the “comments_closed” message. I’ve pored through the source, can’t find a damn thing.
NOTE: I’m using POPUP comments. Therefore, <txp:comments /> and <txp:comments_form> don’t operate (it’s the mysterious <txp:popup_comments /> tag). Ergo, I can’t use <txp:if_comments_open> or any other comment-related conditionals.
Any help/advice? This little detail is driving me up the wall.
“I love Beethoven. Especially the poems.”
- Ringo Starr
Offline
Re: Style the comments_closed paragraph?
Have you turned off “auto-append comments” in the Admin tab? Once you do that, you can use if_comments_closed.
Offline
Re: Style the comments_closed paragraph?
Have you turned off “auto-append comments” in the Admin tab? Once you do that, you can use if_comments_closed.
Yes, i’ve done that, but can’t really use <txp:if_comments_disallowed> for this purpose in this case because the comment display and comment form go in automatically in POPUP mode (like I say, for some reason you can’t use <txp:comments /> and <txp:comments_form /> with popups).
Ideas? I’ve hunted in /publish/taghanders.php and /publish/comment.php and changed stuff around, to no avail.
“I love Beethoven. Especially the poems.”
- Ringo Starr
Offline
Re: Style the comments_closed paragraph?
Sorry, I should’ve clarified. You can use if_comments_allowed in the form, comments_display. I just tested it, and it works using this. Here are the TXP forms:
form: comments_display
<pre>
<txp:if_comments>
<!—if comments are present—>
<h3>Comments</h3>
<dl id="comments">
<txp:comments break="" wraptag="" />
<!—this will output the comments, which use the [comments] form—>
</dl>
</txp:if_comments>
<txp:if_comments_allowed>
<!—if comments are allowed—>
<txp:if_comments_preview>
<!—if someone is previewing a comment, it’ll load in it’s own definition list—>
<dl id="cpreview">
<dt><strong>The following is a comment preview &#8595;</strong></dt>
<txp:comments_preview />
</dl>
<txp:comments_form preview="1" />
<txp:else />
<!—if they have not previewed their comment, than display the comment form (and anything else)—>
<txp:comments_form />
</txp:if_comments_preview>
<txp:else />
<!—"commenting closed message"—>
<p>Comments are closed</p>
</txp:if_comments_allowed>
</pre>
form: popup_comments – you only need one line of TXP code:
<code>
<html>
<etc />
<txp:popup_comments />
</html>
</code>
Last edited by jm (2006-09-16 07:00:44)
Offline
Re: Style the comments_closed paragraph?
Hey, thanks JM! Works like a damn charm! If I could, I’d buy you a drink…
“I love Beethoven. Especially the poems.”
- Ringo Starr
Offline
Re: Style the comments_closed paragraph?
Haha, well I’ve still got four more years ‘til that could happen :D.
Offline
Pages: 1