Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-06-25 15:18:54

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 225
Website Mastodon

Comments section appears three times

For all my articles, the comments section appears three times. What would cause that? My comment forms have hardly changed from the 4.5.2 default template. The form being triplicated is “comments_display”. The default article form only calls it once.

Last edited by skewray (2013-06-25 15:29:27)

Offline

#2 2013-06-25 16:59:54

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 225
Website Mastodon

Re: Comments section appears three times

The default article form ends with:

<!-- if this is an individual article then add the comments section via form: comments_display.article.txp -->
<txp:if_individual_article> <!-- POINT-A -->
  <txp:article form="comments_display" /> <!-- POINT-B -->
</txp:if_individual_article>
</article> <!-- POINT-C -->

where I added the POINT-X comments. What I get is

POINT-A
comment section
comment section
POINT-B
POINT-C
comment section

Last edited by skewray (2013-06-25 17:00:50)

Offline

#3 2013-06-25 17:04:42

etc
Developer
Registered: 2010-11-11
Posts: 5,397
Website GitHub

Re: Comments section appears three times

skewray wrote:

The default article form only calls it once.

Article forms shouldn’t contain comments_display, comments will be appended automatically (by default).

Offline

#4 2013-06-25 20:06:10

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 225
Website Mastodon

Re: Comments section appears three times

Much better without it. I must have added that section for some experiment and forgotten it.

Offline

#5 2013-06-26 08:43:04

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Comments section appears three times

etc wrote:

Article forms shouldn’t contain comments_display, comments will be appended automatically (by default).

Are comments appended automatically now? I thought in recent versions of Textpattern that preference was an opt-in, instead of an opt-out (which it used to be).

The preference in question is “Automatically append comments to articles?”, which should be set to “No” by default.

I’ve never allowed Textpattern to add comments by default – always done it manually using this in my ‘default’ article form…

<!-- if this is an individual article then add the comments section via form: comments_display.article.txp -->
<txp:if_individual_article>
  <txp:article form="comments_display" />
</txp:if_individual_article>

…which is also in the default theme.

Offline

#6 2013-06-26 11:05:40

etc
Developer
Registered: 2010-11-11
Posts: 5,397
Website GitHub

Re: Comments section appears three times

philwareham wrote:

Are comments appended automatically now? I thought in recent versions of Textpattern that preference was an opt-in, instead of an opt-out (which it used to be).

Good question. I have installed the latest (4.5.4) version mainly through updates, but on a fresh test site this option is “on” too, and I don’t remember having changed it.

I’ve never allowed Textpattern to add comments by default – always done it manually using this in my ‘default’ article form…

This works too if “Automatically append comments to articles?” is off, but I don’t remember having modified the default form… could it be 4.6-specific?

Offline

#7 2013-06-26 11:25:01

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Comments section appears three times

philwareham wrote:

<txp:article form="comments_display" />

That totally should be <txp:output_form form="comments_display" />. You ain’t displaying an article, but just including a form.

Offline

#8 2013-06-26 11:43:06

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Comments section appears three times

OK, amended that tag in SVN – thanks Jukka

Offline

#9 2013-07-26 00:31:56

Keepital
Member
Registered: 2013-07-11
Posts: 13

Re: Comments section appears three times

Excellent thread! Very useful —- I was browsing along the topics listed because I have a number of small things that I would like to change on my site, (since I’m a newbie) and in the back of my mind was that the “add a comment” box was being displayed twice. I read the advice from philwareham

Are comments appended automatically now? I thought in recent versions of Textpattern that preference was an opt-in, instead of an opt-out (which it used to be). The preference in question is “Automatically append comments to articles?”, which should be set to “No” by default. I’ve never allowed Textpattern to add comments by default – always done it manually using this in my ‘default’ article form…

and I went into my admin – preferences settings and turned off automatically append comments to articles. And presto! No more double-comment boxes!

The problem I had was that because I am using a theme the forms are already created and they already had ‘comments_display’ throughout them.

Txp Version 4.5.4 – default was no; I changed it to yes when I was setting up my site.

Last edited by Keepital (2013-07-26 00:34:52)

Offline

#10 2013-07-26 12:48:38

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: Comments section appears three times

Keepital wrote:

I changed it to yes when I was setting up my site.

As you seem to edit quite some things (which is great, BTW, cause you turn a template into your own product), I’d recommend rss_admin_db_manager: With the help of this invaluable plugin you make backups of your database and can revert to any state you once had (except for images and files of course, these remain outside of the database, they are only added with their meta data).


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

Board footer

Powered by FluxBB