Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

Related objects

The "Related objects" window in the object edit interface makes it possible to relate other objects to the one that is being edited. Any type of object can be connected to any other type of object. This feature is typically useful in situations when there is a need to bind and/or reuse information that is scattered around in the system.

For example, the concept of related objects makes it possible to add images to news articles. The images can be stored as separate objects outside the article. They can be related to the article and used from within the attributes of the article itself. This approach is quite flexible because it does not enforce any limitations when it comes to the amount and the type of information that is to be included. Please note that if you link to another object (for example you insert a link to a product page in a news article), the object that you link to will be related to the one that is being edited. The following image shows how the "Related objects" window looks like when relations have been made.

The "Related objects" window.

The "Related objects" window.

The screenshot indicates that the object which is currently being edited makes use of two other objects. Related images are displayed as thumbnails. Related files will be displayed with additional information (file type and size). All other objects will be displayed as the one in the "Related content" list as shown in the screenshot above.

The checkboxes and the "Remove selected" button can be used to remove the relations. Please note that it is only the relations that will be removed and not the objects themselves.

The embed links can be copied and pasted into attributes that are using the XML block datatype. For example, if you relate images to an article and would like to have them displayed somewhere in the text, you can just copy & paste the suggested links into the body of the article. Please note that this process becomes much more simple when the Online Editor is installed.

The "Add existing" button makes it possible to browse the node tree and select multiple objects that should be related to the one which is currently being edited. Depending on the user's permissions, the browse functionality will allow the user to select objects located in different parts of the system (Content, Media, Users, etc.). The following image shows what happens when the "Add existing button" is clicked.

Browse for related objects.

Browse for related objects.

The image above shows the main area of the browse interface. This interface makes it possible to select objects that have been placed somewhere in the node tree. Please note that in addition it is possible to use the first three tabs (Content, Media and Users), the path, the left menu and the bookmarks section for navigation.

The "Upload new" button makes it possible to upload new content to the system and automatically relate it to the object that is currently being edited. This button is typically useful when you for example want to relate an image that has not yet been added to the system. The following image shows what happens when this button is clicked.

Upload related content.

Upload related content.

The "Choose" button allows the selection of a file for upload from the local file system. The "Name" field allows the user to set a custom name for the object being uploaded. The "Location" dropdown makes it possible to control where the uploaded file should be placed in the node tree. The "Automatic" setting will let eZ Publish decide the location based on the extension and/or the MIME type of the uploaded file.

When the "Upload" button is clicked, the file will be uploaded to eZ Publish. The system will create an object, the type of the object will be determined using the extension and/or the MIME type of the file. Finally, the object will be related to the one that is being edited and thus it will be visible in the "Related objects" window.

The "Cancel" button aborts the operation and brings the user back to the object edit interface.

Adding related objects as children

When uploading new related objects, you can place them beneath the object that is currently being edited. This can be done by selecting the object's name from the "Location" dropdown in the upload dialog. However, it can only be achieved if the parent object has already been published (otherwise it does not appear in the content tree and can not have any sub items). For example, if a new article is created as a draft, it will not be possible to add related images as children until the draft is published. The following steps demonstrate a solution to this problem:

  1. Publish an unfinished article as hidden node.
  2. Re-edit the article and upload related images as children.
  3. Reveal the article when it is finished.

This procedure can be optimized by checking the "Back to edit" checkbox located in the bottom of the object edit interface (refer to "The object edit interface" section for details).

Balazs Halasy (01/02/2006 3:21 pm)

Geir Arne Waaler (24/08/2010 1:41 pm)

Balazs Halasy, Julia Shymova, Svitlana Shatokhina, Geir Arne Waaler


Comments

  • "Upload new" would be much more usefull if you could browse instead of using a drop down

    A drop down is probably very usefull for a smaller sites, but for large sites very inconvenient. I have ca. 200 local editors with different rights and all have acces to several different folders in "media" and a lot of these folder have subfolder and subfolders' subfolders.
    The best solution would of course be to have an ini setting where you could choose between dropdown or the possibility of browsing, but if this is not possible I think that a browse function (exactly the same way as is used for choosing e.g. an add location) would be a much more usefull way of doing this. In this case you would also be able to use your bookmarks.