{extends $layout}

{block content}

<article id="post-item-category">

	<header class="entry-header">
	
		<div class="category-breadcrumb clearfix">
			<span class="here">{__ 'You are here:'}</span>
			<span class="home"><a href="{!$homeUrl}">{__ 'Home'}</a></span>
			{foreach $ancestors as $anc}
			{first}<span class="ancestors">{/first}
				<a href="{!$anc->link}">{!$anc->name}</a>&nbsp;&nbsp;>
			{last}</span>{/last}
			{/foreach}
			<span class="name"><a href="{!$term->link}">{!$term->name}</a></span>
		</div>

		<h1 class="entry-title">
			<span>{!$term->name}</span>
		</h1>

	</header>

	<div class="entry-content">
		{!$term->description}
	</div>

	<div class="category-items clearfix">

	{include 'snippets/sorting.php'}

	{foreach $posts as $item}
	{first}<ul class="items">{/first}
		<li class="item clear{ifset $item->packageClass} {$item->packageClass}{/ifset}{ifset $item->optionsDir['featured']} featured{/ifset}">
			{if $item->thumbnailDir}
			<div class="thumbnail">
				<a href="{!$item->link}"><img src="{thumbnailResize $item->thumbnailDir, w => 155, h => 115}" alt="{__ 'Item thumbnail'}"></a>
			</div>
			{/if}
			<div class="description">
				<div class="desc-head">
					<h3><a href="{!$item->link}">{$item->title}</a></h3>
					{if $item->rating}
					<div class="item-rating">
						{for $i = 1; $i <= $item->rating['max']; $i++}
							<div class="star{if $i <= $item->rating['val']} active{/if}"></div>
						{/for}
					</div>
					{/if}
					{var $lp = getTourPrice($item->id)}
					{if $lp}<div class="item-price"><span><span>{$lp}</span></span></div>{/if}
				</div>
				<div class="desc-text">
				{!$item->excerpt}
				</div>
			</div>		
		</li>
	{last}</ul>{/last}
	{/foreach}
	</div>
	
	{willPaginate}
	<nav class="paginate-links">
		{paginateLinks true}
	</nav>
	{/willPaginate}

</article><!-- /#post-item-category -->

{ifset $themeOptions->advertising->showBox4}
<div id="advertising-box-4" class="advertising-box">
    {!$themeOptions->advertising->box4Content}
</div>
{/ifset}

{/block}