{fetch( 'content', 'node', hash( 'node_id', 197 ) 
).object.reverse_related_contentobject_count} does not work.

objects that have relations with Node_ID(197) are Users.

This is a problem?


From: Luc Chase 
Sent: Friday, May 13, 2011 4:58 PM
To: Alessio 
Cc: mailing ezpublish 
Subject: Re: [Sdk-public] Knowing whether an object has at least one reverse 
related object


I think it is ok.... you sure that some of those children have 
reverse-related-objects? 


Try it with a simpler example...
{fetch( 'content', 'node', hash( 'node_id', 88 ) 
).object.reverse_related_contentobject_count}


replace 88 with the node_id of the one you know has reverse_related_objects










On 13 May 2011 15:45, Alessio <[email protected]> wrote:

  I have:

  {foreach fetch_alias( 'children', hash( 'parent_node_id', $node.node_id ) ) 
as $item }
  {

  $item.object.reverse_related_contentobject_count} {*  <--- copy paste error 
*} 

  {/foreach}
  But does not work, It's correct?


  From: Luc Chase 
  Sent: Friday, May 13, 2011 4:36 PM
  To: Alessio 
  Cc: mailing ezpublish 
  Subject: Re: [Sdk-public] Knowing whether an object has at least one reverse 
related object


  remember not to confuse object_id and node_id


  On 13 May 2011 15:19, Alessio <[email protected]> wrote:

    Hi!
    {$node.object.reverse_related_contentobject_count} does not work.

    I'm searching with {$node|attribute(show,<number>)} ...



    From: Luc Chase 
    Sent: Friday, May 13, 2011 3:56 PM
    To: Alessio 
    Cc: mailing ezpublish 
    Subject: Re: [Sdk-public] Knowing whether an object has at least one 
reverse related object


    See also fetch reverse related objects count... 
    
http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Modules/content/Fetch-functions/related_objects_count






    On 13 May 2011 14:36, Alessio <[email protected]> wrote:

      Hi!
      I need to know whether an object has reverse related objects
      I found this code:
      {def $objects=fetch( 'content', 'reverse_related_objects',
      hash( 'object_id', $node_id ) )
      $counter = 0}

      {foreach $objects as $object}
      {set $counter=$counter+1}
      {/foreach}
      this here:
      http://doc.ez.no/eZ-Publish/Techn...ch-functions/reverse_related_objects
      In this way I "count" the number of reverse related objects, but I'm sure 
there is another way, because I just want to know if the object has reverse 
objects related or not, I think it's a waste of resources. 

      Thanks 



      --
      Sdk-public mailing list
      [email protected]
      http://lists.ez.no/mailman/listinfo/sdk-public





    -- 
    Luc.
    M. +44.7040-901-582 








  -- 
  Luc.
  M. +44.7040-901-582 








-- 
Luc.
M. +44.7040-901-582 




-- 
Sdk-public mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/sdk-public

Reply via email to