I have:

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

{$loc.object.reverse_related_contentobject_count}

{/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 



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

Reply via email to