Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-08-10 09:50:39

NicKy
Member
Registered: 2007-08-08
Posts: 13

How do i separate the comments from the article ?

Hi,

I want to separate the comments from the article like alistapart.com does.

Basicly :
one page with all the articles => detail of the article WITHOUT the comments => page with all the comments WIHTOUT the article

Is it possible to do this ? with or without a plugin ?

Thanks

Last edited by NicKy (2007-08-10 09:50:54)

Offline

#2 2007-08-10 13:26:16

apsk121
Member
From: Punjab, India
Registered: 2004-09-02
Posts: 36
Website

Re: How do i separate the comments from the article ?

In the admin areas under preferences you have an option not to automatically append comments to articles. And then there’s a dropdown box for selecting comments as popup, so can have the comments in a new popup widow instead of on the article page.

Offline

#3 2007-08-10 23:00:16

jadehouse
Member
Registered: 2007-06-26
Posts: 75

Re: How do i separate the comments from the article ?

apsk121 wrote:

In the admin areas under preferences you have an option not to automatically append comments to articles. And then there’s a dropdown box for selecting comments as popup, so can have the comments in a new popup widow instead of on the article page.

Please look at Alistapart.com. It’s the same question I had.

Offline

#4 2007-08-11 00:18:01

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

Re: How do i separate the comments from the article ?

Have a look at this FAQ. You should be able to do something similar with two article tags and two different forms.

Offline

#5 2007-08-11 00:37:50

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: How do i separate the comments from the article ?

It is not possible. A plugin could do it, but I don’t think one exists yet.

Offline

#6 2007-08-11 13:52:47

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

Re: How do i separate the comments from the article ?

Mary wrote:

It is not possible.

That’s why I said ‘something similar’ :) I’m not sure about this, but I was thinking – roughly – along these lines: in the article form make the comments link go to a page/section ‘comments’, and on that page call the article’s comments with txp:article_custom and an article form that just shows the comments. The difficult part would be to find a way to insert the article’s id to the article_custom tag, but maybe something like chs_if_urlvar could do that?

Offline

#7 2007-08-12 13:18:28

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,634
GitHub Twitter

Re: How do i separate the comments from the article ?

Hi Els,
seems to be a very good and clever solution. I’s looking for a solution a long time ago. All work fine when I use article’s ID within url like this : ?post=ID’s_article_number and use $_GET[‘post’] into comments page to display the corresponding article’s comment form.
I’m trying to paginate the comments page with the help of ob1_googlenav plugin.
Tks lot Els, you’re the man!
Cheers,


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#8 2007-08-12 17:32:03

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

Re: How do i separate the comments from the article ?

Patrick, if you really get this working would you mind posting exactly how you did it? Would be nice if my ‘wild’ idea actually turned out to work :)

Offline

#9 2007-08-12 17:47:53

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How do i separate the comments from the article ?

I think you can do it even nicer, using clean urls.
/section/id/title => shows article
/section/id/title/comments => shows comments.

Something like this (not tested):

<txp:php>
  global $pretext;
  extract(chopUrl($pretext['req']));
  if ($u4 === 'comments') {
    echo parse('
        <!-- all the HTML + TXP tags for showing comments here -->
    ');
  }
  else {
    echo parse('
       <!-- all the HTML + TXP tags for showing the article here -->
    ');
  }
</txp:php>

Or, if you put the comments code in a form called ‘comments_form’ and the article code in a form called ‘article_form’:

<txp:php>
  global $pretext;
  extract(chopUrl($pretext['req']));
  echo parse_form($u4 === 'comments' ? 'comments_form' : 'article_form');
</txp:php>

Last edited by ruud (2007-08-12 17:51:48)

Offline

#10 2007-08-13 07:53:06

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,634
GitHub Twitter

Re: How do i separate the comments from the article ?

WoW!
Do you know this man is a Genius?
As always Ruud make the rule with the most elegant way!
As I said some days ago: world belongs to coders!

One more question Ruud :
Do you think it’s possible to paginate the comment’s page with your code (for the purpose to render exactly Alistapart comments page)?

If you find a solution Ruud, you definitively beat Alistapart and their Ruby on Rail custom CMS

WoW. What a challenge : TXP better than Alistapart…

;-)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#11 2007-08-13 08:00:12

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How do i separate the comments from the article ?

Haha… well, it’s not impossible, but to paginate the comments you’d have to rewrite the <txp:comments /> taghandler in a plugin so it accepts a page number.

Offline

#12 2007-08-13 08:23:41

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,634
GitHub Twitter

Re: How do i separate the comments from the article ?

So… it’s possible!

Ola community. Don’t forget to keep this little code. Now, all TXP websites integrate it for their comments page! Don’t forget to thanks ruud within your websites.

Now you have a new idol : ruud!

I think that Core Developers are better than Jeffrey Zeldman, Eric Meyer and J.-S. Maria :)

Tks lot.
Respects,

Last edited by Pat64 (2007-08-13 08:31:44)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

Board footer

Powered by FluxBB