Self on Default selection item - Object relation

Author Message

Sao Tavi

Thursday 09 June 2011 10:54:37 am

I need to be able to allow the editors to select one object as default "content" for the parent.

So... The editors will be able to add more children to an object and to select one of these children as default "behavior" for the parent. The problem is that I want to restrict the options to the children of the current object and not allow them to browse for it in another objects.

Is this possible through the options or do I need to create a custom datatype?

Marko Žmak

Thursday 09 June 2011 11:34:10 am

Hm, maybe you could use the object realtions datatype (note the plural) and then set "Template based, single" for the selection method.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Sao Tavi

Thursday 09 June 2011 11:42:26 am

Thank you, Marko

I didn't knew that that option exists.

Anyway, as I had really close to what I needed, I alredy created the new datatype. On the other hand, wouldn't changing the template change the functionality of these datatype site wide?

Marko Žmak

Thursday 09 June 2011 12:00:18 pm

The template you would be using is:

  • templates/node/view/objectrelationlist.tpl

and since it's a node view templates I suppose the same override keys are applied. So you shold be able to use different templates for different classes.

Maybe also the attribute identifier could be used as the override key, but you should dig a little bit more to find that out.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

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 02:59:35
Script start
Timing: Jan 18 2025 02:59:35
Module start 'layout'
Timing: Jan 18 2025 02:59:35
Module start 'content'
Timing: Jan 18 2025 02:59:36
Module end 'content'
Timing: Jan 18 2025 02:59:36
Script end

Main resources:

Total runtime1.2677 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 588.0469152.6406
Module start 'layout' 0.00540.0026 740.687539.4844
Module start 'content' 0.00801.2584 780.1719546.0469
Module end 'content' 1.26630.0013 1,326.218812.1250
Script end 1.2676  1,338.3438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2436160.0002
Check MTime0.00130.0998160.0001
Mysql Total
Database connection0.00070.055510.0007
Mysqli_queries1.218796.1374600.0203
Looping result0.00050.0416580.0000
Template Total1.238197.720.6191
Template load0.00200.161420.0010
Template processing1.236097.504520.6180
Template load and register function0.00020.012810.0002
states
state_id_array0.00110.090610.0011
state_identifier_array0.00130.100820.0006
Override
Cache load0.00170.1329200.0001
Sytem overhead
Fetch class attribute can translate value0.00050.043120.0003
Fetch class attribute name0.00130.102450.0003
XML
Image XML parsing0.00080.062520.0004
class_abstraction
Instantiating content class attribute0.00000.001460.0000
General
dbfile0.00240.1915180.0001
String conversion0.00000.000840.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/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.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