{if ($parent == 0 && $current_page != "catalog") || !empty($categories[$parent].children)} {/if}