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)
|