Selecting multiple objects at once for object relations

Author Message

Marc Boon

Saturday 11 March 2006 6:27:02 am

I have some questions about the Object Relations datatype and the Enhanced Object Relation datatype.

1. I would like to be able to specify a starting location to browse for objects. Now it always starts in the root folder of the content tree. I always have to switch to Media folder first when I need to select an Image object. Is there a way to specify a location for browsing?

2. The Object Relations datatype only lets you select one object at a t ime, using the radio button. I wuld like to be able do select multiple objects from the same folder, which would be easy if the radio buttons were replaced with checkboxes. Can this be done?

3. The Enhanced Object Relation datatyp lets you specify checkboxes as a selection mechanism, and a folder location, but then you can't browse to another location. You can only select from one particular folder. How do you browse for objects in a folder tree with the Enhanced Object Relation datatype?

Marc Boon

Saturday 11 March 2006 3:22:32 pm

I found out how to do this by studying the comments in the ini files in /settings.
Two ini files control browsing and object selection behaviour:
browse.ini and content.ini

In browse.ini actions are defined for various browsing tasks.
In content.ini these browsing actions can be tied to class attributes. So you can control the browsing behaviour for every class attribute individually.

To customise the browsing behaviour for my admin site, I created browse.ini.append.php and content.ini.append.php files in /settings/siteaccess/admin.

In browse.ini.append.php, I defined additional browsing actions, like this one for selecting multiple images from the Images folder, using checkboxes:

[AddRelatedImages]
StartNode=images
SelectionType=multiple
ReturnType=ObjectID

In the same browse.ini.append.php file, you can specify aliases for folder nodes, like in the above example for the Images folder:

AliasList[]
AliasList[images]=51

In content.ini.append.php, you can then specify which class attributes use which browsing method. I specified the above defined browsing method for an attribute of type Object Relations, which stores relations to Image objects:

[ObjectRelationDataTypeSettings]
ClassAttributeStartNode[]
ClassAttributeStartNode[]=267;AddRelatedImages

267 is the attribute id of my attribute, and AddRelatedImages is the name of the action I defined above in browse.ini.append.php

The default browse action for a Object Relation attribute is AddRelatedObjectToDataType, which is defined in browse.ini as:

[AddRelatedObjectToDataType]
StartNode=content
SelectionType=single
ReturnType=ObjectID

Similarly, the default action for a Object Relations attribute is:

[AddRelatedObjectListToDataType]
StartNode=content
SelectionType=multiple
ReturnType=ObjectID

which is identical, except for the selection type (single vs.multiple ie radio buttons vs. checkboxes)

Luc Chase

Tuesday 13 January 2009 3:15:44 am

Anyone know of a way to add upper and/or lower limits to the number of relations which can be added to the object?
e.g. allow up to 6 relations out of a possible 20?

The Web Application Service Provider

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 19 2025 08:55:11
Script start
Timing: Jan 19 2025 08:55:11
Module start 'layout'
Timing: Jan 19 2025 08:55:11
Module start 'content'
Timing: Jan 19 2025 08:55:12
Module end 'content'
Timing: Jan 19 2025 08:55:12
Script end

Main resources:

Total runtime1.1206 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.0059 589.3750152.6406
Module start 'layout' 0.00590.0028 742.015639.4766
Module start 'content' 0.00871.1103 781.4922507.1875
Module end 'content' 1.11900.0015 1,288.679712.1250
Script end 1.1205  1,300.8047 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2736160.0002
Check MTime0.00140.1205160.0001
Mysql Total
Database connection0.00130.114410.0013
Mysqli_queries1.071195.5822570.0188
Looping result0.00070.0631550.0000
Template Total1.087497.020.5437
Template load0.00210.185520.0010
Template processing1.085396.853120.5426
Template load and register function0.00020.016010.0002
states
state_id_array0.00130.118210.0013
state_identifier_array0.00070.065920.0004
Override
Cache load0.00170.1556290.0001
Sytem overhead
Fetch class attribute can translate value0.00060.050020.0003
Fetch class attribute name0.00130.115830.0004
XML
Image XML parsing0.00020.021820.0001
class_abstraction
Instantiating content class attribute0.00000.001430.0000
General
dbfile0.00070.0581100.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
3content/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
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/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: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs