Comment a product

Author Message

Henning Deiters

Wednesday 22 September 2010 7:31:30 am

Hi,

is there a solution to comment a product? Has anybody an idea?

Thank you in advance.

 

Henning

Håvard Bergersen

Wednesday 22 September 2010 11:03:49 am

The easiest way is to include the "comments" parts from ezwebin.:

<div class="attribute-comments">                                    
<a name="comments" id="comments"></a>                                    
<h1>{"Comments"|i18n("design/ezwebin/full/blog_post")}</h1>                                    
<div class="content-view-children">                                        
{foreach fetch_alias( comments, hash( parent_node_id, $node.node_id ) ) as $comment}                                            
{node_view_gui view='line' content_node=$comment}                                        
{/foreach}                                    
</div>
                                   
{if fetch( 'content', 'access', hash( 'access', 'create', 'contentobject', $node, contentclass_id, 'comment' ) )}                                   

<form method="post" action={"content/action"|ezurl}>    
<input type="hidden" name="ClassIdentifier" value="comment" />              
<input type="hidden" name="NodeID" value="{$node.object.main_node.node_id}" />   
<input type="hidden" name="ContentLanguageCode" value="{ezini( 'RegionalSettings', 'ContentObjectLocale', 'site.ini')}" />                                       
<input class="new_comment button" type="submit" name="NewButton" value="{'New comment'|i18n( 'design/ezwebin/full/article' )}" />                                   
</form>                                   

{else}                                       
{if ezmodule( 'user/register' )}                                           
<p>{'%login_link_startLog in%login_link_end or %create_link_startcreate a user account%create_link_end to comment.'|i18n( 'design/ezwebin/full/blog_post', , hash( '%login_link_start', concat( '<a href="', '/user/login'|ezurl(no), '">' ), '%login_link_end', '</a>', '%create_link_start', concat( '<a href="', "/user/register"|ezurl(no), '">' ), '%create_link_end', '</a>' ) )}</p>                                       
{else}                                           
<p>{'%login_link_startLog in%login_link_end to comment.'|i18n( 'design/ezwebin/article/comments', , hash( '%login_link_start', concat( '<a href="', '/user/login'|ezurl(no), '">' ), '%login_link_end', '</a>' ) )}</p>             
{/if}                                
</div>

Just remember to give the users you want to be able to comment, the access to add comments.

'content', 'create', class( 'comment' ), parent class( 'product' )

And edit the product class to be a container..

Henning Deiters

Thursday 23 September 2010 12:05:58 am

Hi Håvard,

it's working fine. Thanks a lot! :-)

Best regards from Hamburg // Henning

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 15 2025 09:10:53
Script start
Timing: Jan 15 2025 09:10:53
Module start 'layout'
Timing: Jan 15 2025 09:10:53
Module start 'content'
Timing: Jan 15 2025 09:10:54
Module end 'content'
Timing: Jan 15 2025 09:10:54
Script end

Main resources:

Total runtime1.4851 sec
Peak memory usage6,144.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 685.4297183.6719
Module start 'layout' 0.00720.0036 869.101652.5313
Module start 'content' 0.01081.4728 921.63281,771.0391
Module end 'content' 1.48350.0015 2,692.671968.5703
Script end 1.4851  2,761.2422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00620.4152160.0004
Check MTime0.00140.0930160.0001
Mysql Total
Database connection0.00080.054910.0008
Mysqli_queries1.426296.0342570.0250
Looping result0.00050.0344550.0000
Template Total1.431896.420.7159
Template load0.00450.299720.0022
Template processing1.427396.109120.7137
Template load and register function0.00150.098910.0015
states
state_id_array0.00430.288010.0043
state_identifier_array0.00390.260420.0019
Override
Cache load0.00390.2629190.0002
Sytem overhead
Fetch class attribute can translate value0.00060.039920.0003
Fetch class attribute name0.00250.167140.0006
XML
Image XML parsing0.00180.118020.0009
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00260.1758160.0002
String conversion0.00000.000640.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/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
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: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs