{extends file='page.tpl'}

{block name='page_header_container'}{/block}

{block name="page_content_container"}
    <section id="content" class="page-content">
        {if isset($chposts) && !empty($chposts)}
            <div class="chcreateur_post">
                <div class="chcreateur_post_inner">
                    {foreach from=$chposts item=chselection name=chposts}
                        <article id="blog_post" class="blog_post blog_post_{$chselection.post_format} clearfix">
                            <div class="blog_post_content">
                                <div class="blog_post_content_top col-lg-12 col-md-12 col-xs-12">
                                    <div class="post_thumbnail">

                                        {if isset($chselection.video) & !empty($chselection.video) }
                                            {if $chselection.video|@count > 1 }
                                                {assign var="class" value='newSlide owl-carousel'}
                                            {else}
                                                {assign var="class" value=''}
                                            {/if}
                                            {include file="module:chcreateur/views/templates/front/post-video.tpl" postvideos=$chselection.video width='870' height="482" class=$class arrow="0"}
                                        {elseif isset($chselection.audio) & !empty($chselection.audio) }
                                            {if $chselection.audio|@count > 1 }
                                                {assign var="class" value='newSlide owl-carousel'}
                                            {else}
                                                {assign var="class" value=''}
                                            {/if}
                                            {include file="module:chcreateur/views/templates/front/post-audio.tpl" postaudio=$chselection.audio class=$class arrow="0"}
                                        {elseif  isset($chselection.gallery_lists) & !empty($chselection.gallery_lists) }
                                            {if $chselection.gallery_lists|@count > 1 }
                                                {assign var="class" value=''}
                                            {else}
                                                {assign var="class" value='responsive'}
                                            {/if}
                                            {include file="module:chcreateur/views/templates/front/post-gallery.tpl" gallery_lists=$chselection.gallery_lists imagesize="gallery_default" class=$class arrow="1"}
                                        {else}
                                            <img class="img-responsive" src="{$chselection.post_img.post_default}"
                                                alt="{$chselection.post_title}">
                                        {/if}

                                    </div>
                                </div>

                                <div class="blog_post_content_bottom col-lg-12 col-md-12 col-xs-12">
                                    <h3 class="post_title"><a href="{$chselection.link}">{$chselection.post_title}</a></h3>
                                    <p class="excerpt">{$chselection.post_excerpt}</p>
                                    <div class="post_content">
                                        {$chselection.post_content|strip_tags|truncate:400:"...":true}
                                    </div>
                                    <div class="readmorenoir">
                                        <a class="read_more" href="{$chselection.link}">{l s='Continue' mod='xipblog'}</a>
                                    </div>
                                    <div class="trait {if $smarty.foreach.chposts.last} dernier {/if}"></div>
                                </div>

                            </div>
                        </article>
                    {/foreach}
                </div>
            </div>
        {/if}
    </section>

{/block}