Edit visualization - uppercase

Author Message

Lo' F.

Wednesday 27 April 2011 12:37:59 pm

Hi there,

In the user registration form I need to render an input field text in uppercase.

How can I pass the string upcase() function to the content object attribute on edit template visualization {attribute_edit_gui attribute=$attribute} ?

Many thanks!

loredanaebook.it

André R.

Thursday 28 April 2011 1:55:38 am

Override the attribute view for that specific attribute during editing using content/datatype/edit/*.tpl

But before you do that, if needed enable DebugOutput and ShowUsedTemplates to see which template is used. So you know which one to copy.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Lo' F.

Monday 30 May 2011 7:21:12 am

Hi! Sorry André, I let this topic behind some other jobs and only today I had the chance to go back to it.

Thank you, as always, for your precious hint.

- created an override for the edit view of ezstring.tpl datatype inside my extension

- then declaired the onkeyup event for the attribute_edit_gui this way

{default attribute_base='ContentObjectAttribute'
         ...
        onkeyup=false()}
<input ... {if $onkeyup} onkeyup="{$onkeyup}"{/if} />
{/default}

- and recalled the event within the attribute call

{attribute_edit_gui attribute=$attribute onkeyup="this.value=this.value.toUpperCase()"}

loredanaebook.it

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

Main resources:

Total runtime1.3904 sec
Peak memory usage4,096.0000 KB
Database Queries58

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0076 587.9141152.6250
Module start 'layout' 0.00760.0273 740.539139.4531
Module start 'content' 0.03491.3541 779.9922543.3594
Module end 'content' 1.38900.0014 1,323.351612.1641
Script end 1.3903  1,335.5156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.2839160.0002
Check MTime0.00150.1061160.0001
Mysql Total
Database connection0.00100.071510.0010
Mysqli_queries1.334395.9639580.0230
Looping result0.00060.0438560.0000
Template Total1.323295.220.6616
Template load0.00220.158120.0011
Template processing1.321095.009120.6605
Template load and register function0.00020.017510.0002
states
state_id_array0.00220.159710.0022
state_identifier_array0.00110.079420.0006
Override
Cache load0.00170.1249220.0001
Sytem overhead
Fetch class attribute can translate value0.00060.046020.0003
Fetch class attribute name0.00140.103950.0003
XML
Image XML parsing0.00100.074620.0005
class_abstraction
Instantiating content class attribute0.00000.000960.0000
General
dbfile0.00110.0770230.0000
String conversion0.00000.001340.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.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: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs