{% extends 'default_frame.twig' %}
{% block stylesheet %}
<style>
.toc{
position: relative;
margin: 0 0 7rem;
width: 100%;
background: #f9f9f9;
border: 1px solid #aaa;
padding: 1rem 2rem;
}
.toc__title{
margin-bottom: 0!important;
font-size: 1.2em!important;
}
.toc>ul{
padding-left: 2rem;
}
.toc ul{
counter-reset: item;
list-style-type: decimal;
}
.toc ul ul{
padding-left: 2rem;
}
</style>
{% endblock %}
{% block javascript %}
<script>
$(function(){
$('a[href^="#"]').click(function(){
var href= $(this).attr("href");
var target = $(href == "#" || href == "" ? 'html' : href);
var position = target.offset().top - 150;
$("html, body").animate({scrollTop:position}, 300, "swing");
return false;
});
});
</script>
{% endblock %}
{% block main %}
<div class="ec-recommended-page">
<div class="ec-banner">
<div class="ec-banner__inner">
<div class="inner">
<h2>
{% set category = blog.getBlogCategories[0].getCategory %}
{% if category.getId == 1 %}
コラム
{% else %}
工事実績
{% endif %}
</h2>
</div>
</div>
<div class="ec-breadcrumb">
<ul class="ec-breadcrumb__menu">
<li class="ec-breadcrumb__item"><a href="{{ url('homepage') }}">TOP</a></li>
<li class="ec-breadcrumb__item"><span>></span></li>
{% for category in blog.getBlogCategories %}
<li class="ec-breadcrumb__item">
<a href="{{ url('cm_blog_pro_page_list', {categories: [category.getCategory().getId()]}) }}">
{{ category.getCategory.getName|raw }}
</a>
</li>
<li class="ec-breadcrumb__item"><span>></span></li>
{% endfor %}
<li class="ec-breadcrumb__item">
<p>{{ blog.getTitle|length > 20 ? blog.getTitle|striptags|replace({(' '):' '})|slice(0, 20)|raw ~ '...' : blog.getTitle|raw }}</p>
</li>
</ul>
</div>
</div>
<div class="ec-recommended-main">
<div class="ec-recommended__inner">
<div class="inner">
<div class="ec-recommended__group">
<div class="header">
<div class="group">
<p>{{blog.release_date|date('Y.m.d')}}</p>
{% for category in blog.getBlogCategories %}
<span>{{ category.getCategory.getName|raw }}</span>
{% endfor %}
</div>
<div class="title-main">
<p>{{ blog.title }}</p>
</div>
<figure class="figure__main_image">
{% if blog.getMainListImage %}
<img src="{{ asset(blog.getMainListImage|no_image_product, 'save_image') }}" class="main_image_blog"></img>
{% else %}
<img class='item_blog_image'></img>
{% endif %}
{% if blog.getFigCaption %}
<figcaption>{{ blog.getFigCaption }}</figcaption>
{% endif %}
</figure>
</div>
<div class="content">
{# {{ blog.body|raw }} #}
{{ CustomizeBlogContent(blog.body)['toc']|raw }}
{{ CustomizeBlogContent(blog.body)['html']|raw }}
</div>
<div class="list-btn">
{% set category = blog.getBlogCategories[0].getCategory %}
{% set prev = CustomizeNextPost(blog.id, category.getId == 1, true) %}
{% if prev != null %}
<a href="{{ url('cm_blog_pro_page_detail', {'id': prev.slug ? prev.slug : prev.id}) }}" class="page prev"></a>
{% endif %}
{% if category.getId == 1 %}
<a href="{{ url('columns') }}" class="btn"><span>一覧へ戻る</span></a>
{% else %}
<a href="{{ url('results') }}" class="btn"><span>一覧へ戻る</span></a>
{% endif %}
{% set next = CustomizeNextPost(blog.id, category.getId == 1) %}
{% if next != null %}
<a href="{{ url('cm_blog_pro_page_detail', {'id': next.slug ? next.slug : next.id}) }}" class="page next"></a>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}