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 18 2025 03:01:27
Script start
Timing: Jan 18 2025 03:01:27
Module start 'layout'
Timing: Jan 18 2025 03:01:27
Module start 'content'
Timing: Jan 18 2025 03:01:27
Module end 'content'
Timing: Jan 18 2025 03:01:27
Script end

Main resources:

Total runtime0.7944 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 587.8125152.6094
Module start 'layout' 0.00600.0033 740.421939.4141
Module start 'content' 0.00930.7838 779.8359510.6875
Module end 'content' 0.79310.0012 1,290.523412.1875
Script end 0.7944  1,302.7109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4285160.0002
Check MTime0.00130.1613160.0001
Mysql Total
Database connection0.00060.075410.0006
Mysqli_queries0.746794.0016570.0131
Looping result0.00050.0605550.0000
Template Total0.764796.320.3823
Template load0.00220.280320.0011
Template processing0.762495.977120.3812
Template load and register function0.00020.028110.0002
states
state_id_array0.00080.102710.0008
state_identifier_array0.00130.167420.0007
Override
Cache load0.00190.2391190.0001
Sytem overhead
Fetch class attribute can translate value0.00070.093220.0004
Fetch class attribute name0.00090.116440.0002
XML
Image XML parsing0.00120.153220.0006
class_abstraction
Instantiating content class attribute0.00000.000940.0000
General
dbfile0.00240.2979160.0001
String conversion0.00000.001040.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.0001 secs