Sylvain Le Bihan
Sylvain Le Bihan

Reputation: 163

isfolder & HasChildren not working with modx 2.3

I can't make [[!HasChildren]] & [[*isfolder]] work with modx 2.3, it always display the same result with the checkbox container checked... Is it normal ? Is there an alternative ?

[[*isfolder:is=`1`:then=`toto`:else=`titi`]]

Upvotes: 0

Views: 489

Answers (1)

Vasis
Vasis

Reputation: 2281

Snippet get_childrens_count

<?php
$count = 0;
$criteria = array(
    'parent' => $modx->resource->get('id'),
    'deleted' => false,
    'published' => true,
);
$count = $modx->getCount('modResource', $criteria);
return $count;

usage:

[[!get_childrens_count:gt=`0`:then=`toto`:else=`titi`]]

Upvotes: 1

Related Questions