{if $count > 0}
    {foreach from=$cats item=node}
        {if $node.depth !== 1} {continue} {/if}
        <div class="row">
            <div class="title">
                {$node.category_name}
            </div>
            <div class="content">
            {Portfolio action="categories" allrow='categories' category=$node.category_name|cat:'*'}
            {if !empty($categories)}
            <ul class='workk'>
                {foreach from=$categories item=categ name='foo'}
                    {if $smarty.foreach.foo.first} {continue} {/if} 
                    <li>{$categ.category_name}</li>
                {/foreach}
            </ul>
            {/if}
            </div> <!-- content -->
        </div><!-- ./ROw -->
    {/foreach}
{/if}