Customizing edit template... in a strange way

Author Message

Nabil Alimi

Sunday 12 June 2005 1:43:59 am

Hi,

I created a class "formation" with several fields.
Most of them are just common text fields. But there are two of them which I want to be "selections".
But the problem, is that I want the combo box to be filled dynamically with content created by the webmaster.
In order to, i created a class named "type" and all of thoses "type" content will be stored in a folder.
Then, when the user creates new content "formation", the normal text fields just display and the <select> is field with <option ...> TYPE.

When customizing the edit template, it only shows "edit_attribute.tpl". I checked the edit_attribute.tpl file but i dont really understand how does it works.
I'd like to somehom restrict the displayed fields in edit_formation.tpl to normal text fields.

Thanks for reading me.

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

Paul Borgermans

Sunday 12 June 2005 3:30:30 am

Hi ,

I would suggest to use the objectrelation datatype for the "selection fields" . This does exactly what you want without needing to edit the edit template(s)

Just use a drop down list for the selection method and slect the node/folder where your types are listed. If there is a new type added, it will automatically appear in the drop down list when editing your "formation" class

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Nabil Alimi

Sunday 12 June 2005 8:37:44 am

That sounds really good. :)

I'll give it a try. Thanks a lot ! :)

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

Nabil Alimi

Sunday 12 June 2005 10:54:59 am

I followed your advice Paul, but it seems that Object Relations is restricted to objects created before the class is created. The only choice in the type dropdown box is "only existing objects".
Is there a way to set it to get even new content ?

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

Paul Borgermans

Sunday 12 June 2005 12:41:42 pm

Ah,

I thought your type objects existed before objects of the formation class are created and that over time, some new types may be defined which will be available when editing existing formation objects or new formation objects.

But can't you create the folder already and fill it with a dummy type before ceating the formation class?

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Nabil Alimi

Sunday 12 June 2005 2:48:10 pm

Well. I just can't understand what's happening. ^^

I tried a couple of hours ago and "objectrelation" didn't match what i expected. Then i tried with "objectrelationS" and it did, but it worked only with existing content (as i explained).
And I tried again with "objectrelation" and it works exactly like i'd like. Content added after the creation of the class is displayed in the dropdownbox...
I swear i'm not drunk.

Anyway thanks for your help Paul. ^^

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

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 19:30:32
Script start
Timing: Jan 18 2025 19:30:32
Module start 'layout'
Timing: Jan 18 2025 19:30:32
Module start 'content'
Timing: Jan 18 2025 19:30:32
Module end 'content'
Timing: Jan 18 2025 19:30:32
Script end

Main resources:

Total runtime0.8095 sec
Peak memory usage4,096.0000 KB
Database Queries66

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 590.0391152.6406
Module start 'layout' 0.00690.0024 742.679739.4766
Module start 'content' 0.00930.7990 782.1563584.4844
Module end 'content' 0.80830.0012 1,366.640620.1250
Script end 0.8094  1,386.7656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4088160.0002
Check MTime0.00130.1633160.0001
Mysql Total
Database connection0.00130.158110.0013
Mysqli_queries0.745592.1008660.0113
Looping result0.00050.0643640.0000
Template Total0.774495.720.3872
Template load0.00190.233520.0009
Template processing0.772595.431120.3862
Template load and register function0.00010.010910.0001
states
state_id_array0.00240.292810.0024
state_identifier_array0.00230.285120.0012
Override
Cache load0.00160.2031410.0000
Sytem overhead
Fetch class attribute can translate value0.00060.078820.0003
Fetch class attribute name0.00140.170680.0002
XML
Image XML parsing0.00090.115820.0005
class_abstraction
Instantiating content class attribute0.00000.0031120.0000
General
dbfile0.00090.1093230.0000
String conversion0.00000.001240.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
6content/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
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs