{php} $GLOBALS['total_index'] = 0; $GLOBALS['total_count'] = $this->_tpl_vars['item']->siteMapPagesCount; $GLOBALS['break'] = 0; $additionalPages = array(); {/php} {foreach from = $item->siteMap item = 'doc'} {if $doc.isAdditional == 'n'} {php} $GLOBALS['total_index'] = $GLOBALS['total_index'] + 1; {/php} {include file="Sitemap/item.tpl"|SMGetTemplate} {else} {php} $additionalPages[] = $this->_tpl_vars['doc']; {/php} {/if} {php} if($GLOBALS['total_index'] > $GLOBALS['total_count'] / 2 && $GLOBALS['break'] == 0) { echo ''; $GLOBALS['break'] = 1; } {/php} {/foreach} {php} $this->assign('additionalPages', $additionalPages); {/php} {foreach from=$additionalPages item=doc} {include file="Sitemap/item.tpl"|SMGetTemplate} {/foreach}