Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-09-16 01:58:12

mikeg
Member
From: Edmonton, Canada.
Registered: 2005-02-21
Posts: 31
Website

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

#2 2006-09-16 02:27:59

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

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

#3 2006-09-16 05:13:46

mikeg
Member
From: Edmonton, Canada.
Registered: 2005-02-21
Posts: 31
Website

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

#4 2006-09-16 06:58:29

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

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>
&lt;txp:if_comments&gt;
&lt;!—if comments are present—&gt; &lt;h3&gt;Comments&lt;/h3&gt; &lt;dl id=&quot;comments&quot;&gt; &lt;txp:comments break=&quot;&quot; wraptag=&quot;&quot; /&gt; &lt;!—this will output the comments, which use the [comments] form—&gt; &lt;/dl&gt;
&lt;/txp:if_comments&gt;
&lt;txp:if_comments_allowed&gt;
&lt;!—if comments are allowed—&gt; &lt;txp:if_comments_preview&gt; &lt;!—if someone is previewing a comment, it’ll load in it’s own definition list—&gt; &lt;dl id=&quot;cpreview&quot;&gt; &lt;dt&gt;&lt;strong&gt;The following is a comment preview &amp;#8595;&lt;/strong&gt;&lt;/dt&gt; &lt;txp:comments_preview /&gt; &lt;/dl&gt; &lt;txp:comments_form preview=&quot;1&quot; /&gt; &lt;txp:else /&gt; &lt;!—if they have not previewed their comment, than display the comment form (and anything else)—&gt; &lt;txp:comments_form /&gt; &lt;/txp:if_comments_preview&gt;
&lt;txp:else /&gt;
&lt;!—&quot;commenting closed message&quot;—&gt; &lt;p&gt;Comments are closed&lt;/p&gt;
&lt;/txp:if_comments_allowed&gt;
</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

#5 2006-09-16 14:24:02

mikeg
Member
From: Edmonton, Canada.
Registered: 2005-02-21
Posts: 31
Website

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

#6 2006-09-16 20:03:23

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Style the comments_closed paragraph?

Haha, well I’ve still got four more years ‘til that could happen :D.

Offline

Board footer

Powered by FluxBB