Snippet: Template logic to find object by node_id or object_id

Question

How can you 'find' an object, if all that is known is the node_id?

Answer

{{def $my_node=fetch( 'content', 'node', hash( 'node_id', $node.node_id ) )
      $my_object=$my_node.object} 
{$my_node.name|wash}

External reference