Reply button for comments

Author Message

Pascal France

Saturday 29 April 2006 8:58:06 am

Hi,

I would like to know if there is a way to add a "Reply" button under each article comment ?
Like that we could have a thread of discussion instead of having comments under the orthers.

Regards

Pascal

PS: I sent a first post, but it seems that it disappeared

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Stuart Fenton

Monday 01 May 2006 1:21:32 pm

If they're disappearing make sure you have updated your users roles and permissions to be able to READ them. Login as the administrator, which is usually setup to see all objects. If you can't see them when logged in as the admin then make sure you have added the objects to your layout design.

You can also look at the forum templates to see which buttons are added and using what code.

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Pascal France

Tuesday 02 May 2006 12:09:01 am

Hi Fats,

I'm not sure to well understand what you mean.
Anonymous users can "Add" comments, but there is no Reply button like here:

http://ez.no/doc/ez_publish/technical_manual/3_7/templates/template_basics

where you can add a comment but can also reply to a specific comment.

Are you able to display such a button on your site ?
At present I set Anonymous role like that:

content   read 	 Class( Comment ) , Section( Standard )
content   edit 	   Class( Comment ) , Section( Standard ) , Owner( Self )

Should I have to add some another policy ?

Regards

Pascal

PS: I run eZP 3.7.5

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Stuart Fenton

Tuesday 02 May 2006 12:50:22 am

In order to have any buttons appear you must set a rule to tell ez to do so.

If you look for the privileges related to "comments" you will find that they are able to be created as children of specific classes. Just find the" CREATE" role for comments allow comments to be added as children of comments

content create Class( Comments ) , Section( Standard ) , ParentClass( Comments )

Then you can write comments as replies to comments.

But it depends if you want them to appear hierarchical. If this is the case your better looking at the forum classes to understand what?s going on. In their case they have different classes doing different things.

In your case you could have a ?Comment? class used to comment on Products etc and a new class called ?reply? which you would use to reply to comments. You would add a new privilege to your role to make it work.

content create Class( Reply ) , Section( Standard ) , ParentClass( Comment )

In the override template for your new ?reply? class you would specify the button to read as Reply instead of submit.

You will also need to add your ?read? and ?edit? privileges as well.

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Nabil Alimi

Wednesday 03 May 2006 1:36:10 am

Hi Pascal,

First of all. Did you add the form with the correct parameters including destination node, class id and the "NewButton" submit button ?

Without this, the reply button will not come come up by itself. Setting policies is a point. Making the action available is one other.

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

Pascal France

Wednesday 03 May 2006 10:33:07 am

Hi Fats,

And thanks for your reply.
I tried to follow your steps and I did the following template:
http://www.linuxorable.net/temp/templates/comment.tpl.txt

I did it from a copy of design/plain/override/templates/full/forum_topic.tpl

Now, as you can see here:
http://www.linuxorable.net/ez_test3.7.5/index.php/plain/nouvel_article

I can add a new comment and reply to it.
But I have two troubles:

1/ Let's say we have a "New comment". If I reply (B) to a reply (A) (which is the first reply to "New comment"), the reply B won't be below the reply A. Reply B will be displayed at the end of the replies list like all replies. ( comment_reply class has well the "container" flag set to TRUE). It seems I have to do a loop, but I don't understand which one ?

2/ I use a comment_reply class and a comment_reply.tpl (I did the good override to use this template). When I send a reply form, I don't come back to the article. The comment_reply.tpl is here:
http://www.linuxorable.net/temp/templates/comment_reply.tpl.txt

How can I set the "$main_node_id" in <input type="hidden" name="MainNodeID" value="{$main_node_id }" /> so that it is the node of the article ?

To Nabil: doest these infos answers your post ?

Regards

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.