{layout='layouts/_html-wrapper'}

{!-- embed for breadcrumb, needed to pass arguments (embeds aren't evil) --}
{layout:set name='breadcrumbs'}
	{embed='common/_breadcrumb'
		p_url='{layout:p_url}'
		p_title='{layout:p_title}'
		{if layout:entry_ch}entry_ch='{layout:entry_ch}'{/if}
	}
{/layout:set}

		<section class="row reverse pad">
			<section class="w-12">
				{layout:contents}
			</section>
			<section class="w-4">
				<div class="sidebar">
					<ul class="list">
						{!--
							sub navigation
							==============
							This is a dynamic way to create sub navigation for this section. I use the parameter dynamic='no' to prevent the URL from changing the output of a channel entries tag. I also use a status of 'Default Page' to determine the, well default page.
							NOTE: A channel should only have one Default Page.
						--}
						{exp:channel:entries channel='{layout:ch}' disable='{layout:ch_disable}' dynamic='no' orderby='status' sort='asc' status='{layout:ch_status}'}
							{!-- we need to treat the default page link a little differently so we check for the 'Default Page' status and output it, then all other page links output below that. We use the orderby='status' and sort='asc' parameters to accomplish this. --}
							{if status == 'Default Page'}
								<li><a{if segment_1 == '{layout:p_url}' AND segment_2 == ''} class="act"{/if} href="{path='{layout:p_url}'}">{title}</a></li>
							{if:else}
								<li><a{if segment_2 == '{url_title}'} class="act"{/if} href="{path='{layout:p_url}/{url_title}'}">{title}</a></li>
							{/if}
						{/exp:channel:entries}
					</ul>
				</div>
			</section>
		</section>