app/template/default/blog/detail.twig line 1

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% block stylesheet %}
  3.     <style>
  4.         .toc{
  5.             position: relative;
  6.             margin: 0 0 7rem;
  7.             width: 100%;
  8.             background: #f9f9f9;
  9.             border: 1px solid #aaa;
  10.             padding: 1rem 2rem;
  11.         }
  12.         .toc__title{
  13.             margin-bottom: 0!important;
  14.             font-size: 1.2em!important;
  15.         }
  16.         .toc>ul{
  17.             padding-left: 2rem;
  18.         }
  19.         .toc ul{
  20.             counter-reset: item;
  21.             list-style-type: decimal;
  22.         }
  23.         .toc ul ul{
  24.             padding-left: 2rem;
  25.         }
  26.     </style>
  27. {% endblock %}
  28. {% block javascript %}
  29.     <script>
  30.         $(function(){
  31.             $('a[href^="#"]').click(function(){
  32.                 var href= $(this).attr("href");
  33.                 var target = $(href == "#" || href == "" ? 'html' : href);
  34.                 var position = target.offset().top - 150;
  35.                 $("html, body").animate({scrollTop:position}, 300, "swing");
  36.                 return false;
  37.             });
  38.         });
  39.     </script>
  40. {% endblock %}
  41. {% block main %}
  42. <div class="ec-recommended-page">
  43.     <div class="ec-banner">
  44.         <div class="ec-banner__inner">
  45.             <div class="inner">
  46.                 <h2>
  47.                     {% set category = blog.getBlogCategories[0].getCategory %}
  48.                     {% if category.getId == 1 %}
  49.                         コラム
  50.                     {% else %}
  51.                         工事実績
  52.                     {% endif %}
  53.                 </h2>
  54.             </div>
  55.         </div>
  56.         <div class="ec-breadcrumb">
  57.             <ul class="ec-breadcrumb__menu">
  58.                 <li class="ec-breadcrumb__item"><a href="{{ url('homepage') }}">TOP</a></li>
  59.                 <li class="ec-breadcrumb__item"><span>></span></li>
  60.                 {% for category in blog.getBlogCategories %}
  61.                     <li class="ec-breadcrumb__item">
  62.                         <a href="{{ url('cm_blog_pro_page_list', {categories: [category.getCategory().getId()]}) }}">
  63.                             {{ category.getCategory.getName|raw }}
  64.                         </a>
  65.                     </li>
  66.                     <li class="ec-breadcrumb__item"><span>></span></li>
  67.                     
  68.                 {% endfor %}
  69.                 
  70.                 <li class="ec-breadcrumb__item">
  71.                     <p>{{ blog.getTitle|length > 20 ? blog.getTitle|striptags|replace({('&nbsp;'):' '})|slice(0, 20)|raw ~ '...' : blog.getTitle|raw }}</p>
  72.                 </li>
  73.             </ul>
  74.         </div>
  75.     </div>
  76.     <div class="ec-recommended-main">
  77.         <div class="ec-recommended__inner">
  78.             <div class="inner">
  79.                 <div class="ec-recommended__group">
  80.                     <div class="header">
  81.                         <div class="group">
  82.                             <p>{{blog.release_date|date('Y.m.d')}}</p>
  83.                             {% for category in blog.getBlogCategories %}
  84.                                 <span>{{ category.getCategory.getName|raw }}</span>
  85.                             {% endfor %} 
  86.                         </div>
  87.                         <div class="title-main">
  88.                             <p>{{ blog.title }}</p>
  89.                         </div>
  90.                         <figure class="figure__main_image"> 
  91.                             {% if blog.getMainListImage %}
  92.                                 <img src="{{ asset(blog.getMainListImage|no_image_product, 'save_image') }}" class="main_image_blog"></img>
  93.                             {% else %}
  94.                                 <img class='item_blog_image'></img>
  95.                             {% endif %}
  96.                             {% if blog.getFigCaption %}
  97.                                 <figcaption>{{ blog.getFigCaption }}</figcaption>
  98.                             {% endif %}
  99.                         </figure>
  100.                     </div>
  101.                     <div class="content">
  102.                         {# {{ blog.body|raw }} #}
  103.                         {{ CustomizeBlogContent(blog.body)['toc']|raw }}
  104.                         {{ CustomizeBlogContent(blog.body)['html']|raw }}
  105.                     </div>
  106.                     
  107.                     <div class="list-btn">
  108.                         {% set category = blog.getBlogCategories[0].getCategory %}
  109.                         {% set prev = CustomizeNextPost(blog.id, category.getId == 1, true) %}
  110.                         {% if prev != null %}
  111.                             <a href="{{ url('cm_blog_pro_page_detail', {'id': prev.slug ? prev.slug : prev.id}) }}" class="page prev"></a>
  112.                         {% endif %}
  113.                         {% if category.getId == 1 %}
  114.                             <a href="{{ url('columns') }}" class="btn"><span>一覧へ戻る</span></a>
  115.                         {% else %}
  116.                             <a href="{{ url('results') }}" class="btn"><span>一覧へ戻る</span></a>
  117.                         {% endif %}
  118.                         {% set next = CustomizeNextPost(blog.id, category.getId == 1) %}
  119.                         {% if next != null %}
  120.                             <a href="{{ url('cm_blog_pro_page_detail', {'id': next.slug ? next.slug : next.id}) }}" class="page next"></a>
  121.                         {% endif %}
  122.                     </div>
  123.                 </div>
  124.             </div>
  125.         </div>
  126.     </div>
  127. </div>
  128. {% endblock %}