Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-02-21 20:52:43
- Rexel
- Member
- Registered: 2005-11-18
- Posts: 26
commenting closed for this article
Hi all
I’m fairly new txp.
I have some static articles that will be viewed individually.
at the moment I see the “Commenting closed for this article” message at the end of each.
How can I get rid of the “Commenting closed for this article” for these articles but leave it for the rest of entries?
taking out the
<code><txp:text item=“comments_closed” /></code>
from of the comment display form remove it for all posts as expected, so far I couldn’t figure it out
any suggestions?
Thank you.
Last edited by Rexel (2006-02-22 01:03:26)
Offline
Re: commenting closed for this article
FAQ for posting code.
As for comments, If you completely want to eliminate the comment invite, create a custom form that duplicates the default article form, just omits <txp:comments_invite />. The form override (under advanced options on the write tab) will allow you to select the form.
Yes, I have tried turning it off and on.
Offline
#3 2006-02-22 01:37:39
- Rexel
- Member
- Registered: 2005-11-18
- Posts: 26
Re: commenting closed for this article
Thank you Alesh for pointing out the FAQ .
I think you miss-understood my question, or maybe I didn’t explain myself as I should.
I was refering to the message that appear at the end of a post when comments are off on an individual article, not the comment invite.
Basically I don’t want that message to show on static non blog pages, just on articles/blog pages if comments are no longer open for individual articles.
This is the current form that I have:
<code>
<txp:comments />
<txp:if_comments_allowed>
<txp:comments_form />
<txp:else />
<txp:text item=“comments_closed” />
</txp:if_comments_allowed>
</code>
With the form above, the message “comments closed for this article” don’t show when the article is displayed on the section it belong to, but when viewed on its own the message is there.
Example: take an article with the title “project1” on the portfolio page, when viewed with the url http://example.com/portfolio, no message is visible.
Click the title takes you to the url http://example.co/portfolio/project1 and the message’s back up again.
Last edited by Rexel (2006-02-22 01:39:15)
Offline
#4 2006-02-22 20:20:46
- Rexel
- Member
- Registered: 2005-11-18
- Posts: 26
Re: commenting closed for this article
Anyone can help shed some light on this….
Looks like commenting is really closed for this article …. lolll
Last edited by Rexel (2006-02-22 20:21:29)
Offline
#5 2006-02-22 21:22:46
- Luxebot
- Member

- From: Los Angeles
- Registered: 2006-02-18
- Posts: 25
Re: commenting closed for this article
Hi Rexel, this is what I have in my comments_display form:
< txp:if_comments_allowed >
< txp:comments_form / >
< txp:else / >
< /txp:if_comments_allowed >
It gets rid of the “commenting closed for this article” line perfectly.
Offline
#6 2006-02-23 00:55:19
- Rexel
- Member
- Registered: 2005-11-18
- Posts: 26
Re: commenting closed for this article
Thanks Luxebot
But that get rid of the “commenting closed for this article” for all posts, I want to get rid of it for the static non blog articles only.
Offline
#7 2006-02-23 16:40:58
- Rexel
- Member
- Registered: 2005-11-18
- Posts: 26
Re: commenting closed for this article
Tried to look at the source code of txp but ended up with a head ack.
I was so embroled in txp tags that I was convienced that the solution reside in using some txp tags or hacks and maybe it is.
But CSS came to the rescue, again.
The trick is: in the comment_display form, enclose the message in a <p> tag or what ever tag you want, give it a class or an id name, then use css to indent the text or use display: none; to hide it from view.
Because I need to hide the message for non blog posts only, applying display: none or indenting the text will hide it in all posts, so giving each page a <body> id name based on the section it belong to using the <txp:section /> tag will enable us to target and apply css for non blog pages only.
So here is it.
comments_display form:
<code><txp:comments /></code>
<code><txp:if_comments_allowed></code>
<code><txp:comments_form /></code>
<code><txp:else /></code>
<code><p class=“no_comments_msg”>Comments closed for this article.</p></code>
<code></if_comments_allowed></code>
page template, pass the <body> the section name as an id name:
<body id="<txp:section />">
CSS:
for non blog pages
body#section_name .no_comments_msg { display: none;}
for the rest
.no_comments_msg { style it your way }
Not an ideal solution as the messgae is still there in the source code, but will do fine for visual browsers and me.
If someone know/find a better way to get rid of the message all together specially from the source code of a page, I’ll be happy to see/implement it
Offline
#8 2006-02-24 00:16:04
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: commenting closed for this article
Rexel, what you can do is:
- Turn off comment auto-append (its in the admin prefs).
- Take the contents of comments_display, and put them in your article form.
- Create a different article form for your static articles, and put your adjusted version of comments_display in it.
Offline
Re: commenting closed for this article
Rexel wrote:
But that get rid of the “commenting closed for this article” for all posts, I want to get rid of it for the static non blog articles only.
Hi Rexel,
first try mary’s suggestion, you will learn interesting stuff in the process.
Then, you can also try a bit of txp:if_article_section magic (dont get confused with txp:if_section magic).
In your article form, where you put all your comment stuff, try something like:
<code><txp:if_article_section name=“static”>
<txp:else />
…all your comment stuff (tags, etc) here
</txp:if_article_section></code>
Of course, change the name="static" for the name of the section where you asign your “static non blog articles”.
The above snippet means: “if the article belongs to section ‘static’ do not output anything. Else, output all the comment stuff.”
Offline
#10 2006-02-25 00:30:19
- Rexel
- Member
- Registered: 2005-11-18
- Posts: 26
Re: commenting closed for this article
Thank you all for your help.
I will try all of that and report back.
Offline
Re: commenting closed for this article
Hi…
I have the same problem as Rexel’s… and I see a couple of workarounds, but I’d like to better understand how it works…
I’m actually using a form I designed for my articles my_article, and another one (my_article_list) for a list of article titles of articles.
My idea is to allow you to click in anyone of this list and this would generate a page with the same list of articles and the selected article below.
The code in the page template looks something like this:
bc..
<div class=“lista”>
<h2>The Title</h2>
<txp:article_custom form=“my_article_list” limit=“11” section=“descarriado” sortby=“Posted”
sortdir=“asc” listform=“my_article_list” />
<txp:if_individual_article>
<txp:article limit=“1” form=“my_article” />
</txp:if_individual_article>
</div>
and it kinda work… but, even when I’m using my own (non-default) article form (my_article), it still seems to be using the dreaded comments_display form at the end of the form… I thought it was the <txp:comments_invite wraptag="p" /> at the end of the default article form what invoked the comments_display form, but it seems to be hardwired somewhere… is it so? why?
What I tried then was to replace the <txp:article limit="1" form="my_article" /> with <txp:article_custom limit="1" form="my_article" /> and this eliminated the comments_display form from the bottom… but it always shows the last article in the list, no matter which one I choose… does it remember that it depleted the whole list?
TIA
Mariano Absatz – El Baby
I don’t suffer from insanity. I enjoy every minute of it.
Offline
Pages: 1