Forums / Setup & design / can't get price datatype to show in generated web page

can't get price datatype to show in generated web page

Author Message

nigel dodd

Friday 15 October 2004 6:38:51 am

In a class I define a field (id mealprice) to have the datatype Price. After putting in some data the backend shows the price correctly with the £ currency symbol. The template to show this in the frontend is:

    <tr>
        <td><b>{$node.object.data_map.mealprice.contentclass_attribute.name}:</b></td>
        <td>{attribute_view_gui attribute=$node.object.data_map.mealprice}</td>
    </tr>

however the generated page shows the attribute name "Price" but no value or £ sign. Other fields eg TextLines show up correctly. I specified the UK locale when I set up ez.

I am relatively new to ez so the answer is probably obvious to somebody with more experience.

nigeldodd@blueyonder.co.uk

Lazaro Ferreira

Friday 15 October 2004 6:18:19 pm

Hi,

Enable ezp debug output , and check it for any error or warning related

to enable debug output go to your site.ini.append.. file and add the lines

[DebugSettings]
DebugOutput=enabled

clear your templates cache after that

The line below is rendered by another template : .../content/datatype/view/ezprice.tpl

{attribute_view_gui attribute=$node.object.data_map.mealprice}

Lazaro
http://www.mzbusiness.com

Paul Forsyth

Saturday 16 October 2004 2:34:05 am

Its always worth looking at how eZ do this. Look at:

design/standard/templates/content/datatype/view/ezprice.tpl

to see how the price is rendered. In this case you will need to '|l10n(currency)' to your line to render it correctly.

paul

nigel dodd

Saturday 16 October 2004 5:07:50 am

Thanks, but

<tr>
    <td><b>{$node.object.data_map.mealprice.contentclass_attribute.name}:</b></td>
    <td>{attribute_view_gui attribute=$node.object.data_map.mealprice|l10n(currency)}</td>
</tr>

still produces a blank output. Just to confirm, the first char of l10n is a lowercase L?
Additional experiment:

<tr>
   <td><b>{$node.object.data_map.pricefloat.contentclass_attribute.name}:</b></td>
   <td>{attribute_view_gui attribute=$node.object.data_map.pricefloat|l10n(currency)}</td>
</tr>

where now the datatype of pricefloat is a Float (instead of Price), also results in blank output, however removing the |l10n(currency) pipe causes it to be rendered correctly. What is the fundamental datatype of Price? Is it float? Why does the |l10n(currency) not work on a float? Why is there blank output of the Price datatype with and without the pipe?

In the Content view in the backend the mealprice is correctly rendered:
Price
Price £ 15.00
so the data has been input correctly but I still cannot get it to render in the frontend.

I have (according to the second reply in this thread) activated eZ debug and so can see if there are synatax errors. In the egs above there are no syntax errors reported.

Any help greatly appreciated

nigeldodd@blueyonder.co.uk

nigel dodd

Monday 18 October 2004 3:52:09 am

It was a path problem. I had set the AdditionalSiteDesignList[]=mynewsite instead of base and so it failed to find price.tpl under the base tree.

There are no reports of templates not found any more and the currency displays ok with or without the pipe to l10(currency). However I now get an eZ debug warning:

Operator 'l10' is not registered

So I wonder what that means and how do I register it?

nigeldodd@blueyonder.co.uk

Frederik Holljen

Monday 18 October 2004 4:00:31 am

try using "l10n" not "l10".

eZ debug

Timing: Jan 18 2025 11:23:31
Script start
Timing: Jan 18 2025 11:23:31
Module start 'content'
Timing: Jan 18 2025 11:23:32
Module end 'content'
Timing: Jan 18 2025 11:23:32
Script end

Main resources:

Total runtime1.0259 sec
Peak memory usage4,096.0000 KB
Database Queries207

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 587.9531180.8125
Module start 'content' 0.00750.8673 768.7656657.0625
Module end 'content' 0.87470.1510 1,425.8281341.0391
Script end 1.0258  1,766.8672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.4285210.0002
Check MTime0.00160.1536210.0001
Mysql Total
Database connection0.00130.124010.0013
Mysqli_queries0.932190.85842070.0045
Looping result0.00300.29182050.0000
Template Total0.991996.720.4959
Template load0.00210.209220.0011
Template processing0.989796.471720.4949
Template load and register function0.00010.011210.0001
states
state_id_array0.00100.100610.0010
state_identifier_array0.00210.200420.0010
Override
Cache load0.00190.1816480.0000
Sytem overhead
Fetch class attribute can translate value0.00140.133350.0003
Fetch class attribute name0.00260.250080.0003
XML
Image XML parsing0.00170.164850.0003
class_abstraction
Instantiating content class attribute0.00000.0023100.0000
General
dbfile0.00290.2841330.0001
String conversion0.00000.000630.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs