override layout for attributes

Author Message

Matt Brady

Thursday 26 October 2006 9:06:58 pm

I'm trying to redesign the attributes layout of a create/edit class but not sure how to do it.
What I wanted to do was just override the edit.tpl and lay out the form so that it looks better and has the correct field sizes but I'm having no luck.

For example: Within a class I create a new text attribute "post code" with max string length of 4. When I go to create a new object the default layout of the edit form all text fields are the same size. I want to at least get the fields the correct size.

Is this the best way to do this or am I way off... can anyone give a few pointers here?

It's not easy being easy.

Daniele Nocentini

Tuesday 31 October 2006 2:39:23 am

maybe you must override only text attribute datatype template instead edit.tpl, try to override this:

standard\templates\content\datatype\edit\eztext.tpl for your class or only a single specified attribute.

Antica Bottega Digitale srl
http://www.abd.it

Matt Brady

Tuesday 31 October 2006 1:50:05 pm

Hi Daniele,
Thanks for that... yes, that's the first thing I did however I couldn't quite grasp it... you can't select the class and attribute through the template wizard so I assume you need to rewrite the template for each text field. So... the default is
----------------------------------------------------
{default attribute_base='ContentObjectAttribute' html_class='full'}
<textarea id="ezcoa-{if ne( $attribute_base, 'ContentObjectAttribute' )}{$attribute_base}-{/if}{$attribute.contentclassattribute_id}_{$attribute.contentclass_attribute_identifier}" class="{eq( $html_class, 'half' )|choose( 'box', 'halfbox' )} ezcc-{$attribute.object.content_class.identifier} ezcca-{$attribute.object.content_class.identifier}_{$attribute.contentclass_attribute_identifier}" name="{$attribute_base}_data_text_{$attribute.id}" cols="70" rows="{$attribute.contentclass_attribute.data_int1}">{$attribute.content|wash}</textarea>
{/default}
----------------------------------------------------
My class is content_report and attribute is postcode. Now I want to change the field to be only 4 characters long and restricted to 4 characters.... I also want to add some text beside the label.
Any idea how I would change the template to suit? Once I have one done it will make a lot more sense to me and I'll be able to edit the others with no prob.

Any help here would be greatly appreciated.

It's not easy being easy.

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 21:12:41
Script start
Timing: Jan 18 2025 21:12:41
Module start 'layout'
Timing: Jan 18 2025 21:12:41
Module start 'content'
Timing: Jan 18 2025 21:12:42
Module end 'content'
Timing: Jan 18 2025 21:12:42
Script end

Main resources:

Total runtime1.0595 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.0050 587.9141152.6250
Module start 'layout' 0.00500.0028 740.539139.4609
Module start 'content' 0.00791.0501 780.0000532.6016
Module end 'content' 1.05790.0015 1,312.601612.1641
Script end 1.0595  1,324.7656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3067160.0002
Check MTime0.00140.1305160.0001
Mysql Total
Database connection0.00050.045510.0005
Mysqli_queries1.015795.8641570.0178
Looping result0.00050.0497550.0000
Template Total1.031897.420.5159
Template load0.00220.203420.0011
Template processing1.029697.178420.5148
Template load and register function0.00020.022610.0002
states
state_id_array0.00120.115910.0012
state_identifier_array0.00120.112820.0006
Override
Cache load0.00180.1704220.0001
Sytem overhead
Fetch class attribute can translate value0.00060.058020.0003
Fetch class attribute name0.00100.092940.0002
XML
Image XML parsing0.00060.055920.0003
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00070.0676160.0000
String conversion0.00000.000740.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
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/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: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs