[MIGX] Count rows in nested TV

Hi, guys.
Tpl:

[[getImageList?
        &tvname=`TVFields1`
        &tpl=`TVFields1`
    ]]

TVFields1 Chunk:

<h1>[[+title]]</h1>
<p>
    [[getImageList?
        &tvname=`TVFields2`
        &tpl=`TVFields2`
    ]]

TVFields2 (nested in TVFields1) chunk:

<code>
<strong>[[+value1]]</strong><br />
</code>

How I can do that: if TVFields2 contains 1 row or nothing - do one. Else, do another? How I can get count of rows in nested TV Set from chunk?

Thank you.

1 Like
[[+value1]]

isn’t working? Try putting it in TVFields1 tpl, underneath the second getImageList call.

If it still doesn’t work make sure it can show if put right under title

Thank you, but I mean another. How I can do that (like PHP code):

foreach( $TVFIelds1 as $row1 )
{
echo "<h1>$row[title]</h1>';
if ( count ($TVFIelds2) == 1 )  { 
// ONE CODE
} else {
// DO ANOTHER CODE
}

…where $TVFields2 is nested TV Fieldset on TV fieldset $TVFields1.