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.

eZ debug

Timing: Jan 19 2025 00:17:49
Script start
Timing: Jan 19 2025 00:17:49
Module start 'layout'
Timing: Jan 19 2025 00:17:49
Module start 'content'
Timing: Jan 19 2025 00:17:50
Module end 'content'
Timing: Jan 19 2025 00:17:50
Script end

Main resources:

Total runtime0.8639 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 589.0313152.6250
Module start 'layout' 0.00630.0034 741.656339.4453
Module start 'content' 0.00980.8528 781.1016625.4766
Module end 'content' 0.86260.0013 1,406.578120.1641
Script end 0.8639  1,426.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3781160.0002
Check MTime0.00130.1512160.0001
Mysql Total
Database connection0.00080.087610.0008
Mysqli_queries0.793091.7925680.0117
Looping result0.00080.0905660.0000
Template Total0.830596.120.4152
Template load0.00200.231420.0010
Template processing0.828595.895620.4142
Template load and register function0.00020.027810.0002
states
state_id_array0.00120.134710.0012
state_identifier_array0.00130.145320.0006
Override
Cache load0.00180.2074630.0000
Sytem overhead
Fetch class attribute can translate value0.00090.104230.0003
Fetch class attribute name0.00150.168980.0002
XML
Image XML parsing0.00110.124530.0004
class_abstraction
Instantiating content class attribute0.00000.002190.0000
General
dbfile0.00100.1176220.0000
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
16content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
9content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 37
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs