Path

ez.no / exponential / documentation / customization / components / datatypes / ezobjectrelation / selecting related objects with dropdown boxes, checkboxes, etc.


Selecting related objects with dropdown boxes, checkboxes, etc.

These documentation pages are no longer maintained. Please visit the new documentation site.

Normally Exponential uses a browse function to select objects which should be linked. This workflow might be sufficient for occasionally linking objects but it is very time consuming. It is much easier to choose from a dropdown list of available objects. You also have the option to restrict which objects are allowed to be linked. This all can be achieved just with template programming.

To achieve this, you should do the following steps:

1. Create the directory templates/content/datatype/edit in your current design directory.

2. Create the file ezobjectrelation.tpl in this directory with the following content:

{section name=top loop=fetch( content, list, hash( parent_node_id, 2 ) )}

   <select name="ContentObjectAttribute_data_object_relation_id_{$attribute.id}">

       <option value="{$:item.contentobject_id}">{$:item.name|wash}</option>

   </select>

{/section}

Now, if you create a document which has an object relation attribute then you should get a dropdown box of all objects in the root directory. This is just a first example and it should be refined.

The important thing to remember is that the HTTP POST variable ContentObjectAttribute_data_object_relation_id_{$attribute.id} has the content object id (not the node id!) as value of the object you want to link to.

Comments

Contents

Customization

Access control
Exponential API Documentation
Content structure
Custom design
Components
    Images
    Datatypes
       eZXMLText
       eZKeyword
       eZObjectRelation
          Selecting related objects with dropdo...
    Shop
    Information collection
    Search
    Form processing
    Error handling
    Icons
    Menus
    Toolbars
Tips & Tricks
Troubleshooting


Created

26/08/2003
10:55:44 am
by Kai Duebbert

Last updated

27/08/2003
3:53:50 am
by Kai Duebbert

Authors

Kai Duebbert



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.