Snippet: Template logic to display content object tree node locations

This is a Stub article. Help the eZ Publish community by expanding it!

Question

'Is there any attribute or other way to find out, if an object has more than one locations?'

Solution

The assigned nodes is available on the object.

Here is an example code that lists all the paths to the assigned nodes:

{foreach $node.object.assigned_nodes as $assignednode}
  {$assignednode.path_identification_string} <br />
{/foreach}<span class="line"></span></pre>

The $node variable has the following available information:
http://ez.no/doc/ez_publish/techn...ence/objects/ezcontentobjecttreenode
The $node.object:
http://ez.no/doc/ez_publish/techn..._8/reference/objects/ezcontentobject

Another Solution

Actually. In your case, you might be able to use the "main_node_only" parameter to the "list" or "tree" fetch to only return the main node of your nodes.
See here:
http://ez.no/doc/ez_publish/techn...modules/content/fetch_functions/list

Reply, "The main_node_only attribute would not work with the particular problem logic I have: I wanted to exclude all "Main Nodes" from the fetch, whose objects are encapsulated by another node (different location)."

External References