Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-04 21:38:29

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

hide commenting in a section?

My aim is ultimately to display all articles in a section without any commenting.
By this I mean not on a post-by-post basis – I don’t even want to display the “commenting closed for this article” message.
The only thread I found on this subject was Automatic Disabling of Comment – Exceptions?, which seems to hit a dead end.

Perhaps its not possible, but here is an issue I encountered while trying to work it out:

In a section, I want the default page to show a particlar article, with an id of ‘24’. The way I understand it, the default www.sitename/section page shows a list, because no article is defined in the URL. (Is this correct?) So my page template shows this for an article_list:
<code><txp:if_article_list><txp:article_custom form=“about” limit=“1” id=“24” /></txp:if_article_list></code>

The correct article is displayed, without any sign of comments. I’m assuming this is because its an article_list page, which therefore can’t have any comments (can anyone confirm this?). So far so good.

I have a list of permalinks to other articles for that section.
My page template shows this for an individual_article:
<code><txp:if_individual_article><txp:article form=“about” limit=“1” /></txp:if_individual_article></code>

But when you click through to the www.sitename/section/articlename URLs to view these articles, commenting is displayed.

By trial and error I switched <code>article</code> to <code>article_custom</code> for the individual_article code and found that the article displayed shows no commenting :) Brilliant!
Then I tried to select another article and found that the same one (the newest one) is displayed for all URLs in that section. :-(

This is what I don’t understand. Why does using article_custom make the same (newest) article display for all article URLs in that section? I’m hoping if someone can explain this, it might lead to a solution to the main problem.

Offline

#2 2006-01-04 21:54:04

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: hide commenting in a section?

My aim is ultimately to display all articles in a section without any commenting.
By this I mean not on a post-by-post basis – I don’t even want to display the “commenting closed for this article” message.

My advice would be turn off “auto-append comments to articles”. And then depending on your section-template either call <txp:output_form form="comments_display" /> or leave it out. Leaving it out in the template means nothing for/about comments will be displayed. Putting the above call in, will do what “auto-append” would otherwise do for you: append the comments_display form each time an article is shown.

In a section, I want the default page to show a particlar article, with an id of ‘24’. The way I understand it, the default www.sitename/section page shows a list, because no article is defined in the URL. (Is this correct?)

Yes it is correct, as long as you have a tag <tcp:article /> in the template. article is responsible for showing the content, meaning lists of articles, individual articles, etc. all based on the current url.

By trial and error I switched <code>article</code> to <code>article_custom</code> for the individual_article code and found that the article displayed shows no commenting :) Brilliant!
Then I tried to select another article and found that the same one (the newest one) is displayed for all URLs in that section. :-(

The whole purpose of article_custom is to display information independant of the url. So yes, article_custom will always show the same thing, otherwise it would be equivalent to article, no?

Offline

#3 2006-01-04 22:05:18

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: hide commenting in a section?

That is possibly the most clear and speedy response I could have hoped for :o)
thanks very much

Offline

Board footer

Powered by FluxBB