Customizing an attribute's view

Author Message

H-Works Agency

Wednesday 09 March 2011 3:50:16 am

Hello,

How can i modify - with php customs methods - the way an attribute is viewed ?

In concrete terms i have to modify the way ezprice amount is displayed depending on some custom predefined rules.

I've checked ini files and have seen in datatype.ini a [ViewSettings] with GroupedInput[] variable : Is there a way to use this to intercalate some clean php code between kernel ezprice.php and the {$attribute.value} ?

Thanx in advance !

EZP is Great

Sebastiaan van der Vliet

Wednesday 09 March 2011 4:08:04 am

Hi,

Do you mean you want to change/clean the price that is actually displayed? Like {$attribute.value|do_something_before_outputting}?

Certified eZ publish developer with over 9 years of eZ publish experience. Available for challenging eZ publish projects as a technical consultant, project manager, trouble shooter or strategic advisor.

Fou Jino

Wednesday 09 March 2011 5:37:29 am

You can for example add a custom template operator which take in parameters the price and return a string with the price modifier like you want

Foujino ~ http://www.foujino-blog.be

H-Works Agency

Wednesday 09 March 2011 6:32:28 am

Uhm yes of course i can do that...thanx for the help

EZP is Great

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 29 2025 23:45:03
Script start
Timing: Jan 29 2025 23:45:03
Module start 'layout'
Timing: Jan 29 2025 23:45:03
Module start 'content'
Timing: Jan 29 2025 23:45:03
Module end 'content'
Timing: Jan 29 2025 23:45:03
Script end

Main resources:

Total runtime0.0145 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 588.1328151.2109
Module start 'layout' 0.00510.0027 739.343836.6563
Module start 'content' 0.00780.0055 776.000094.0625
Module end 'content' 0.01330.0011 870.062533.9766
Script end 0.0145  904.0391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002215.0044140.0002
Check MTime0.00107.0271140.0001
Mysql Total
Database connection0.00074.551010.0007
Mysqli_queries0.002819.494630.0009
Looping result0.00000.095410.0000
Template Total0.00085.610.0008
Template load0.00064.233710.0006
Template processing0.00021.344910.0002
Override
Cache load0.00042.910110.0004
General
dbfile0.001912.957580.0002
String conversion0.00000.041140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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