{include file="header.tpl" title=$section.name keywords=$section.keywords description=$section.description}

{fetch_articles perPage=10 assign=news assignPagination=pagination page=$page section=$section.sectionId path=$section.path seFriendly=true image=true articleId=null}

<main class="main">

	{* banner page *}
	{include file="modules/banner.tpl"}
	{* /banner page *}

	<section class="flex:col pad-tb-50 over-hide">
		<div class="flex:col-max">
			<div class="grid:fr-1 g-gap-40">
				<div class="block-head">
					<div class="text-tmp title-40 title-tt-up title-accent-2"><h2>{$section.name}</h2></div>
				</div>

				<div class="grid:fr-1 g-gap-20">
					{if isset($page) && $page eq 1}
						<div class="news">
							{foreach from=$news item=new name=news}{if $smarty.foreach.news.first}
								{* news item *}
								{include file="items/news.tpl" type="" position="right" truncateTitle=64 truncateSummary=200}
								{* /news item *}
							{/if}{/foreach}

							<div class="news__col">
								{foreach from=$news item=new name=news}{if $smarty.foreach.news.iteration > 1 && $smarty.foreach.news.iteration < 5}
									{* news item *}
									{include file="items/news.tpl" type="gorizontal" position="left" truncateTitle=34 truncateSummary=100}
									{* /news item *}
								{/if}{/foreach}
							</div>

						</div>

						<div class="news news-col">
							{foreach from=$news item=new name=news}{if $smarty.foreach.news.iteration > 4}
								{* news item *}
								{include file="items/news.tpl" type="gorizontal" position="{if $smarty.foreach.news.iteration%2!=0}right{else}left{/if}" truncateTitle=44 truncateSummary=100}
								{* /news item *}
							{/if}{/foreach}
						</div>
					{else}
						<div class="news news-col">
							{foreach from=$news item=new name=news}
								{* news item *}
								{include file="items/news.tpl" type="gorizontal" position="{if $smarty.foreach.news.iteration%2!=0}right{else}left{/if}" truncateTitle=44 truncateSummary=100}
								{* /news item *}
							{/foreach}
						</div>
					{/if}

					{* pagination *}
					{include file="modules/pagination.tpl" class="pagination x-right"}
					{* /pagination *}
				</div>
			</div>
		</div>
	</section>

	{* Котакты *}
	{include file="blocks/contacts.tpl"}
	{* /Котакты *}

</main>

{include file="footer.tpl"}