Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-03-08 11:29:32

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Where does 'Comments are closed' come from?

Help me out with this one please! ‘Comments’ in the txp admin are ‘on’. Only one section will get articles with comments; the articles on other sections get ‘out’ (comments). Now, the following occurs … !!?? … on the permalink of the latest articles I get ‘comments are closed’ at the bottom. I searched all the modules, etc … but where can I ‘switch’ this off?

Look at this screendump

It’s in Dutch but you’ll see what I mean!

Last edited by RedFox (2007-03-08 11:32:44)

Offline

#2 2007-03-08 11:47:53

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Where does 'Comments are closed' come from?

In the (default) form ‘comments_display’ you’ll see this:

<txp:text item="comments_closed" />

It gets the text from the txp_lang table. Look for the string ‘comments_closed’. If you had the Dutch language installed, it would say ‘Reageren gesloten voor dit artikel’.

So you can either change the text in the txp_lang table, or change the ‘comments_display’ form (look at some conditionals like if_comments_allowed).

Last edited by els (2007-03-08 11:55:01)

Offline

#3 2007-03-08 12:19:28

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: Where does 'Comments are closed' come from?

Oops … that’s far away! I never did this before … so, can you search for a typical string via phpAdmin? I’ve looked already in txp_lang table but there are 66 pages of … !!?? … or perhaps you know the ID of that string … that would help me!

Last edited by RedFox (2007-03-08 12:27:51)

Offline

#4 2007-03-08 12:28:03

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: Where does 'Comments are closed' come from?

Ha Els, we are crossposting … :) … arg, why didn’t I look at that module! Please help me to rewrite that one … what have I to do so that articles that may have comments eventually can get ‘comments closed’ and articles that haven’t comments get nothing at all! I’m still a newbie to TXP in this kind of things … :(

Offline

#5 2007-03-08 14:57:55

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: Where does 'Comments are closed' come from?

Admin > Preferences > Automatically append comments to articles? [x] no [ ] yes

Last edited by sthmtc (2007-03-08 15:00:12)

Offline

#6 2007-03-08 15:00:24

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: Where does 'Comments are closed' come from?

@sthmtc – you did read the whole post?

Offline

#7 2007-03-08 15:24:13

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Where does 'Comments are closed' come from?

The easy way, I think it is:

<txp:if_comments_allowed>
... some tags and text...
<txp:else />
</txp:if_comments_allowed>

Maybe you can include some if_article_list or if_individual_article magic.

<txp:if_article_list>
<txp:if_comments_allowed>
... some tags and text...
<txp:else />
</txp:if_comments_allowed>
</txp:if_article_list>

La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#8 2007-03-08 18:02:06

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Where does 'Comments are closed' come from?

You can change this part of ‘comments_display’

<txp:if_comments_allowed>
<txp:comments_form />
<txp:else />
<p><txp:text item="comments_closed" /></p>
</txp:if_comments_allowed>

into

<txp:if_comments_allowed>
<txp:comments_form /> <!-- commenting is on -->
<txp:else />
<txp:if_comments>
<p>Reageren op dit artikel is niet meer mogelijk.</p> <!-- comments have been made, but are not allowed anymore -->
</txp:if_comments>
</txp:if_comments_allowed>

The tags in the default form will show the ‘comments closed’ text when comments are off for that article:

  • when there are comments, but you closed them after a while,
  • when comments have never been on.

My example takes care that the text will only be displayed when there are comments, but they are not allowed anymore.

Hm… reading back this looks a bit confusing, hope I made myself clear.

EDIT! (risking a crosspost again…) sthmtc was right, you need to turn off ‘automatically append comments to articles’ and move the content of ‘comments_display’ to your article form. (if_comments doesn’t seem to work in a comment form)

Edit 2
Further reading: Comment display confusion.

Last edited by els (2007-03-08 18:09:57)

Offline

#9 2007-03-08 20:49:35

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: Where does 'Comments are closed' come from?

OK … thanks to everybody … I’ve to study on it. I let you know when I’ve made it all work … or not! (Is this English?)

[edit]
This is what I did and it works fine!

<txp:comments wraptag="ol" break="li" />
<txp:comments_preview form="comment_preview"/>
<txp:if_comments_allowed>
<txp:comments_form />
<txp:else />
<txp:if_comments>
<p class="comments_closed"><txp:text item="comments_closed" /></p>
</txp:if_comments>
</txp:if_comments_allowed>

Last edited by RedFox (2007-03-19 22:00:02)

Offline

Board footer

Powered by FluxBB