{* $Id: carousel.tpl 52649 2014-09-26 18:17:19Z jonnybradley $ *}
{if $carousel and $carousel.id}{$containerId = $carousel.id}{else}{$containerId = 'wp_list_carousel'}{/if}
<div id="{$containerId}" class="carousel slide" data-ride="carousel"{if $carousel and $carousel.interval} data-interval="{$carousel.interval}"{/if}>
	{* Indicators *}
	<ol class="carousel-indicators">
		{foreach from=$results item=row}
			<li data-target="#{$containerId}" data-slide-to="{$row@index}"{if $row@index eq 0} class="active"{/if}></li>
		{/foreach}
	</ol>

	{* Wrapper for slides *}
	<div class="carousel-inner">
		{foreach from=$results item=row}
			<div class="item{if $row@index eq 0} active{/if}">
				{if $body and $body.field}
					{if $body.mode eq 'raw'}
						{$row[$body.field]}
					{else}
						{$row[$body.field]|escape}
					{/if}
				{/if}

				<div class="carousel-caption">
					{if $caption and $caption.field}
						{if $caption.mode eq 'raw'}
							{$row[$caption.field]}
						{else}
							{$row[$caption.field]|escape}
						{/if}
					{/if}
				</div>
			</div>
		{/foreach}
	</div>

	{* Controls *}
	<a class="left carousel-control" href="#{$containerId}" role="button" data-slide="prev">
		<span class="glyphicon glyphicon-chevron-left"></span>
	</a>
	<a class="right carousel-control" href="#{$containerId}" role="button" data-slide="next">
		<span class="glyphicon glyphicon-chevron-right"></span>
	</a>
</div>
{pagination_links resultset=$results}{/pagination_links}
