Adding comments to an object

Author Message

Christian Johansen

Friday 11 November 2005 6:51:50 am

Hi, I've looked at the tutorial for creating a guestbook: http://ez.no/products/ez_publish_cms/documentation/building_an_ez_publish_site/the_guestbook and allthough it comes close, it doesn't quite help me with what I want to do.

I want to create the possibility for anonymous users to post a comment to an article/arbitrary object. Can anyone point me in the direction of some tutorial/documentation of this?

I've used the built in comment type to add some comments to an article through the admin-interface but I want this functionality on the public site. I don't know which templates to override and such. Also - I don't know how I'm supposed to set the ordering to ascending without manually doing so for each article.

So far I have articles and they appear as containers, I thought this way they could contain articles. But I'm kinda lost, yet still I bet this is standard functionality? Any hints?

Ɓukasz Serwatka

Friday 18 November 2005 12:57:24 am

Hi Christian,

First you will need form which will pass some variables like NodeID of article, ClassID of comment to /content/action module. You can look on design/base/override/templates/full/article.tpl. There already is such code.

You will have to set right permission to Anonymous user, for content create and content edit.

template for comment edit, you can find in design/base/override/templates/edit/comment.tpl

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

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 31 2025 08:09:42
Script start
Timing: Jan 31 2025 08:09:42
Module start 'layout'
Timing: Jan 31 2025 08:09:42
Module start 'content'
Timing: Jan 31 2025 08:09:43
Module end 'content'
Timing: Jan 31 2025 08:09:43
Script end

Main resources:

Total runtime1.3618 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 588.1328151.2109
Module start 'layout' 0.00770.0027 739.343836.6484
Module start 'content' 0.01041.3504 775.9922920.3984
Module end 'content' 1.36070.0010 1,696.39067.8516
Script end 1.3617  1,704.2422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2287160.0002
Check MTime0.00120.0903160.0001
Mysql Total
Database connection0.00080.058410.0008
Mysqli_queries1.309996.1941540.0243
Looping result0.00070.0486520.0000
Template Total1.311296.320.6556
Template load0.00190.141820.0010
Template processing1.309296.142120.6546
Template load and register function0.00170.126210.0017
states
state_id_array0.00230.170210.0023
state_identifier_array0.00300.220720.0015
Override
Cache load0.00160.1164130.0001
Sytem overhead
Fetch class attribute can translate value0.00160.119720.0008
Fetch class attribute name0.00240.177430.0008
XML
Image XML parsing0.00080.058920.0004
class_abstraction
Instantiating content class attribute0.00000.000830.0000
General
dbfile0.00330.2446180.0002
String conversion0.00000.000540.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 7
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs