[SOLVED] Hide the dropdown menu if no multi-option is set

Author Message

Christophe Bourcier

Monday 20 July 2009 9:21:39 am

Hi,

I'm using ezwebin to build an e-commerce solution.

Some products don't have any option, so I enter nothing in the multi-option field.

But on the product page I have a ":" and a blank dropdown menu.

The template I should modify is extension/ezwebin/design/ezwebin/override/templates/full/product.tpl

But I don't see which condition to use. I have tried:

{if $node.data_map.additional_options.has_content}
<div class="attribute-multi-options">
{attribute_view_gui attribute=$node.object.data_map.additional_options}
</div>
{/if}

but it doesn't work.

Any ideas?

Thanks.

Jean-Luc Nguyen

Monday 20 July 2009 9:24:58 am

Hello,

1.
Try to activate debug in the frontend and check List of used templates.
The default additional options should use its own datatype template.

2.
Instead of

{if $node.data_map.additional_options.has_content}

Try

{if $node.data_map.additional_options|count}

Hope this will help.

http://www.acidre.com

Christophe Bourcier

Monday 20 July 2009 9:38:36 am

Thank you for your quick reply.

The debug mode told me to look at extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezmultioption.tpl

I added {if $multioptions.name} before <label>{$multioptions.name}:</label> and {/if} after <select> and it worked.

Thanks again.

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 16:15:13
Script start
Timing: Jan 18 2025 16:15:13
Module start 'layout'
Timing: Jan 18 2025 16:15:13
Module start 'content'
Timing: Jan 18 2025 16:15:14
Module end 'content'
Timing: Jan 18 2025 16:15:14
Script end

Main resources:

Total runtime1.2587 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.0058 588.1563152.6563
Module start 'layout' 0.00580.0023 740.812539.5078
Module start 'content' 0.00811.2493 780.3203536.0156
Module end 'content' 1.25740.0012 1,316.335912.0938
Script end 1.2586  1,328.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.2294160.0002
Check MTime0.00120.0947160.0001
Mysql Total
Database connection0.00120.097710.0012
Mysqli_queries1.209196.0598570.0212
Looping result0.00050.0420550.0000
Template Total1.230397.720.6151
Template load0.00210.167820.0011
Template processing1.228197.574020.6141
Template load and register function0.00020.012310.0002
states
state_id_array0.00100.081310.0010
state_identifier_array0.00150.123120.0008
Override
Cache load0.00170.1377340.0001
Sytem overhead
Fetch class attribute can translate value0.00060.044320.0003
Fetch class attribute name0.00090.068340.0002
XML
Image XML parsing0.00060.051120.0003
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00080.0618160.0000
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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/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: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs