Snippet: Template logic to display content object tree node locations


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


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:
The $node.object:

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:

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