{extends 'main-layout.php'}

{if !$isIndexPage}
	{var $sectionsOrder = isset($post->options('sections-order')->overrideGlobal) ? $post->options('sections-order')->order : null}
{/if}

{block content}
<!-- TOOLBAR -->
<div class="toolbar">

	<div id="breadcrumb">{_}You are here:{/_} {breadcrumbs}</div>

	{include general-search-form.php}

</div>

<!-- SUBPAGE -->
<div id="container" class="subpage subpage-line clear clearfix {isActiveSidebar homepage-widgets-col-2}{else}onecolumn{/isActiveSidebar}">
	<!-- MAINBAR -->
	<div id="content" class="mainbar entry-content clearfix">

			{if !$isIndexPage}
			<h1>{$post->title}</h1>
				
			{/if}

			{if $posts}

				{include general-content-nav.php location => 'nav-above'}

				{include snippet-content-loop.php posts => $posts}

				{include general-content-nav.php location => 'nav-below'}

			{else}

				<article id="post-0" class="post no-results not-found">
					<header class="entry-header">
						<h2 class="entry-title">Nothing Found</h2>
					</header><!-- .entry-header -->

					<div class="entry-content">						
						<p>Sorry, but nothing matched your search criteria. Please try again with some different keywords.</p>						
						{include 'general-search-form.php'}
					</div><!-- .entry-content -->
				</article><!-- #post-0 -->

			{/if}

	</div><!-- end of mainbar -->
	<!-- SIDEBAR -->
	{isActiveSidebar homepage-widgets-col-2}
	<div class="sidebar clearfix right">	
		{dynamicSidebar homepage-widgets-col-2}
	</div><!-- end of sidebar -->
	{/isActiveSidebar}
</div><!-- end of container -->
{/block}

{if !$isIndexPage}
	
	{? isset($post->options('slider')->overrideGlobal) ? $localslider = 'slider' : $localslider = 'xb'}
  {define $localslider}
    <div class="slider-holder">
    {include snippet-custom-home-slider.php,
    	options => $post->options('slider'),
    	slides => $site->create('slider-creator', $post->options('slider')->sliderType),
    	name => $name,
    	desc => $desc
    }
    {include snippet-custom-home-slider.php,
    	options => $post->options('slider'),
    	slides => $site->create('slider-creator', $post->options('slider')->sliderType2),
    	name2 => $name2,
    	desc2 => $desc2
    }
    {include snippet-custom-home-slider.php,
    	options => $post->options('slider'),
    	slides => $site->create('slider-creator', $post->options('slider')->sliderType3),
    	name3 => $name3,
    	desc3 => $desc3
    }
    {include snippet-custom-home-slider.php,
    	options => $post->options('slider'),
    	slides => $site->create('slider-creator', $post->options('slider')->sliderType4),
    	name4 => $name4,
    	desc4 => $desc4
    }
    </div>
  {/define}
  
  {? isset($post->options('testimonials')->overrideGlobal) ? $sectionB = 'sectionB' : $sectionB = 'xb'}
	{define $sectionB}
		{include snippet-custom-testimonials.php, show => $post->options('testimonials')->show, options => $post->options('testimonials')}
	{/define}
{/if}