Problem with edit integer field

Author Message

Lida Popelo

Monday 20 September 2004 9:35:45 am

Hello!
I have a class with a field of type Integer, in this field i'm going to store section id. So i want that this field apear as ComboBox with avaible sections, not a TextBox (as default for Integer type).

I override template "content/datatype/edit/ezinteger.tpl" and put in it following code:

{let section_list = fetch(content, section_list)}

<select name="???????" size="1">

{section var = section loop = $section_list}
  <option value = {$section.id}>{$section.name}</option>
{/section}

</select>

{/let}

It works ok, but what a value i need to assign to 'name' attribute ?

Frederik Holljen

Tuesday 21 September 2004 12:14:40 am

Try:

{default attribute_base=ContentObjectAttribute}
 <select name="{$attribute_base}_data_integer_{$attribute.id}" size="1">
  // your options here.
 </select>
{/default}

This is the way the default template sets the name. I'm not entirely sure it will work in your case, but it is worth a try.

Lida Popelo

Tuesday 21 September 2004 8:20:18 am

Tnank You very much!!!!

It works right for me...
But i think, i doesn't completely understand what the string below means :(

{$attribute_base}_data_integer_{$attribute.id}

Can anybody give me explanation (or link where i can find one) about code in design/standard/templates/content/edit_attribute.tpl,
design/standard/templates/content/datatype/edit/*.tpl

Best Regards,
Lida

Frederik Holljen

Tuesday 21 September 2004 9:27:44 am

This is the way eZ publish recognizes data input. The name of the input field will be something like:
ContentObjectAttribute_data_integer_11. This specific string is recoginized by eZ publish which compares it with the actuall specification of your class. If the name of the input field matches the class definition the data is stored.

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 22:36:39
Script start
Timing: Jan 18 2025 22:36:39
Module start 'layout'
Timing: Jan 18 2025 22:36:39
Module start 'content'
Timing: Jan 18 2025 22:36:40
Module end 'content'
Timing: Jan 18 2025 22:36:40
Script end

Main resources:

Total runtime1.2451 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.9141152.6250
Module start 'layout' 0.00540.0026 740.539139.4609
Module start 'content' 0.00801.2356 780.0000524.4766
Module end 'content' 1.24360.0014 1,304.476612.1641
Script end 1.2450  1,316.6406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.3153160.0002
Check MTime0.00130.1066160.0001
Mysql Total
Database connection0.00080.064310.0008
Mysqli_queries1.193195.8286600.0199
Looping result0.00050.0428580.0000
Template Total1.212297.420.6061
Template load0.00200.162620.0010
Template processing1.210297.197120.6051
Template load and register function0.00030.026910.0003
states
state_id_array0.00120.094210.0012
state_identifier_array0.00070.059020.0004
Override
Cache load0.00170.1336260.0001
Sytem overhead
Fetch class attribute can translate value0.00050.043020.0003
Fetch class attribute name0.00110.087850.0002
XML
Image XML parsing0.00060.048820.0003
class_abstraction
Instantiating content class attribute0.00000.001160.0000
General
dbfile0.00090.0717160.0001
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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 25
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs