Forums / Setup & design / Comment a product

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

eZ debug

Timing: Jan 29 2025 13:40:25
Script start
Timing: Jan 29 2025 13:40:25
Module start 'content'
Timing: Jan 29 2025 13:40:25
Module end 'content'
Timing: Jan 29 2025 13:40:25
Script end

Main resources:

Total runtime0.1141 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0036 587.8281180.8438
Module start 'content' 0.00360.0047 768.671997.8672
Module end 'content' 0.00830.1058 866.5391525.8750
Script end 0.1141  1,392.4141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00292.5567200.0001
Check MTime0.00121.0215200.0001
Mysql Total
Database connection0.00050.410210.0005
Mysqli_queries0.077167.55871410.0005
Looping result0.00100.85151390.0000
Template Total0.105492.410.1054
Template load0.00060.538910.0006
Template processing0.104891.843310.1048
Override
Cache load0.00040.378610.0004
Sytem overhead
Fetch class attribute can translate value0.00090.774610.0009
XML
Image XML parsing0.00020.215610.0002
General
dbfile0.00484.2306200.0002
String conversion0.00000.002730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs