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

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% block javascript %}{% endblock %}
  3. {% block stylesheet %}
  4. <style>
  5. .pluginCMBblog .post_meta {
  6.     display: flex;
  7.     list-style: none;
  8.     margin: 0;
  9.     padding: 0;
  10.     width: 95%;
  11.     margin: 0 auto;
  12. }
  13. .pluginCMBblog .blog_category{
  14.     margin: 0;
  15.     padding: 0;
  16. }
  17. .pluginCMBblog .blog_category{
  18.     display: initial;
  19. }
  20. .pluginCMBblog .blog_category li{
  21.     padding: 3px 5px;
  22.     font-size: 13px;
  23.     color: white;
  24.     background: #333;
  25.     display: initial;
  26.     border-right: 1px solid #ddd;
  27. }
  28. .pluginCMBblog .blog_category li:last-child {
  29.     border-right: none;
  30. }
  31. .pluginCMBblog .post_meta .post_meta_list{
  32.     padding-right: 2rem;
  33. }
  34. {# .pluginCMBblog .list_category_link{
  35.     color: #337ab7;
  36.     padding: 0 0.5rem;
  37. } #}
  38. .pluginCMBblog .figure__main_image {
  39.     padding: 0;
  40.     margin: 3rem 0;
  41.     display: grid;
  42.     justify-content: stretch;
  43.     align-items: flex-end;
  44. }
  45. .pluginCMBblog .main_image_blog,
  46. .pluginCMBblog figcaption {
  47.     padding: 0;
  48.     grid-column: 1/2;
  49.     grid-row: 1/2;
  50. }
  51. .pluginCMBblog figcaption {
  52.     text-align: center;
  53.     padding: 0.4rem 2rem;
  54.     font-size: 1.3rem;
  55.     background-color: rgba(0,0,0,.7);
  56.     color: #fff;
  57.     overflow: hidden;
  58.     white-space: normal;
  59.     word-wrap: break-word;
  60. }
  61. .pluginCMBblog .post_meta_list.time{
  62.     font-size: 13px;
  63.     color: #707070;
  64. }
  65. .pluginCMBblog .tag_dl{
  66.     display: flex;
  67. }
  68. .blog_detail .blog_Title {
  69.     border-bottom: 1px dashed #707070;
  70.     padding-bottom: 18px;
  71.     font-size: 16px;
  72.     color: #333;
  73. }
  74. .blog_detail .ec-productRole__profile {
  75.     font-size: 13px;
  76.     color: #333;
  77. }
  78. .pluginCMBblog .cm_blog_main_image img {
  79.     width: 400px;
  80.     height: 400px;
  81.     margin: auto;
  82.     object-fit: cover;
  83. }
  84. ul.tag-ul {
  85.     padding-left:8px;
  86.     list-style: none;
  87.     display: flex;
  88.     flex-wrap: wrap;
  89. }
  90. ul.tag-ul > li {
  91.     margin: 0.4em;
  92.     padding: 0 0.8em;
  93.     border: 1px solid #ccc;
  94.     border-radius: 5px;
  95. }
  96. ul.tag-ul > li > a:hover {
  97.     text-decoration: none;
  98. }
  99. h3.tag-header {
  100.   padding: 1rem 2rem;
  101.   border-left: 4px solid #000;
  102. }
  103. .w-100 {
  104.     width: 100%
  105. }
  106. .side-bar > div {
  107.     width: 90%;
  108. }
  109. h5.tag-header {
  110.     font-family: Oswald;
  111.     font-weight: bold;
  112.     font-size: 22px;
  113.     color: #333;
  114.     border-bottom: 4px solid #000;
  115. }
  116. .month-archive a {
  117.     margin-bottom: 8px;
  118.     display: block;
  119.     color: #333;
  120. }
  121. .month-archive a:hover {
  122.     color: #337ab7;
  123. }
  124. .ec-productRole__description > p img {
  125.     width: calc(var(--width));
  126.     margin-bottom: 15px;
  127. }
  128. .archive-link-div {
  129.     max-height: 600px;
  130.     overflow-y: scroll;
  131. }
  132. .archive-link-div::-webkit-scrollbar {
  133.     display: none;
  134. }
  135. @media screen and (max-width: 768px){
  136.     .pluginCMBblog .post_meta {
  137.         display: block;
  138.     }
  139.     .pluginCMBblog .post_meta li {
  140.         display: inline-block;
  141.     }
  142.     .side-bar > div {
  143.         width: 100%
  144.     }
  145.     h5.tag-header {
  146.         margin-top: 40px;
  147.     }
  148.     .pluginCMBblog .cm_blog_main_image img {
  149.         width: 60%;
  150.         max-height: 200px;
  151.     }
  152. }
  153. @media only screen and (min-width: 768px) {
  154.     .ec-shelfGrid .ec-shelfGrid__item-image {
  155.         height: 150px;
  156.     }
  157.     h3.tag-header {
  158.         margin: 63px 16px 20px;
  159.     }
  160.     .side-bar {
  161.         width: 280px;
  162.     }
  163.     .ec-role {
  164.         display: flex;
  165.         justify-content: flex-start
  166.     }
  167.     .mt-65 {
  168.         margin-top: 65px!important;
  169.     }
  170. }
  171. </style>
  172. {% endblock %}
  173. {% block main %}
  174. <div class="ec-role blog_detail pluginCMBblog">
  175.     <div class="w-100">
  176.         <div class="ec-off1Grid">
  177.             <div class="ec-off1Grid__cell">
  178.                 <div class="cm_blog_main_image">
  179.                     <figure class="figure__main_image"> 
  180.                         {% if blog.getMainListImage %}
  181.                         <img src="{{ asset(blog.getMainListImage|no_image_product, 'save_image') }}" class="main_image_blog"></img>
  182.                         {% endif %}
  183.                         {% if blog.getFigCaption %}
  184.                         <figcaption>{{ blog.getFigCaption }}</figcaption>
  185.                         {% endif %}
  186.                     </figure>
  187.                 </div>
  188.                 <div class="ec-grid2__cell">
  189.                     <ul class="post_meta">
  190.                         <li class="post_meta_list time">{{blog.release_date|date('Y年m月d日')}}</li>
  191.                         <li class="post_meta_list">
  192.                             <ul class="blog_category">
  193.                                 {% for category in blog.getBlogCategories %}
  194.                                     <li class="{{category.getCategory.class}}"> {{ category.getCategory.getName|raw }} </li>
  195.                                 {% endfor %}        
  196.                             </ul> 
  197.                         </li>
  198.                     </ul>
  199.                     <h1 class="blog_Title">{{ blog.title }}</h1>
  200.                     <div class="ec-productRole__profile">
  201.                         <div class="ec-productRole__description">{{ blog.body|raw }}
  202.                         </div>
  203.                     </div>
  204.                 </div>
  205.             </div>
  206.         </div>
  207.         {# {% if tags|length > 0 %}
  208.             <h3 class="tag-header">{{ 'plg.CMBlogPro.blog.tag'|trans }}</h3>
  209.             <ul class="tag-ul">
  210.                 {% for tag in tags %}
  211.                     <li>
  212.                         <a href="{{ url('cm_blog_pro_page_list', {tag: tag|trim }) }}">{{ tag |trim }}</a>
  213.                     </li>
  214.                 {% endfor %}
  215.             </ul>
  216.         {% endif %}
  217.         <h3 class="tag-header">{{ 'plg.CMBlogPro.blog.related_product'|trans }}</h3>
  218.         <div class="ec-shelfRole">
  219.             <ul class="ec-shelfGrid">
  220.                 {% for product in blog.getBlogProduct %}
  221.                     <li class="ec-shelfGrid__item">
  222.                         <a href="{{ url('product_detail', {'id': product.getProduct.id}) }}">
  223.                             <p class="ec-shelfGrid__item-image">
  224.                                 <img src="{{ asset(product.getProduct.main_list_image|no_image_product, 'save_image') }}">
  225.                             </p>
  226.                             <p>{{ product.getProduct.name }}</p>
  227.                             <p class="price02-default">
  228.                                 {% if product.getProduct.hasProductClass %}
  229.                                     {% if product.getProduct.getPrice02Min == product.getProduct.getPrice02Max %}
  230.                                         {{ product.getProduct.getPrice02IncTaxMin|price }}
  231.                                     {% else %}
  232.                                         {{ product.getProduct.getPrice02IncTaxMin|price }} ~ {{ product.getProduct.getPrice02IncTaxMax|price }}
  233.                                     {% endif %}
  234.                                 {% else %}
  235.                                     {{ product.getProduct.getPrice02IncTaxMin|price }}
  236.                                 {% endif %}
  237.                             </p>
  238.                         </a>
  239.                     </li>
  240.                 {% endfor %}
  241.             </ul>
  242.         </div> #}
  243.     </div>
  244.     <div class="side-bar">
  245.         {% set categoryRepository = repository('Plugin\\CMBlogPro42\\Entity\\Category') %}
  246.         {% set blogCategoryRepository = repository('Plugin\\CMBlogPro42\\Entity\\BlogCategory') %}
  247.         <div class="month-archive">
  248.             <h5 class="tag-header">CATEGORY</h5>
  249.             <div class="category-link">
  250.                 {% for Category in categoryRepository.findAll() %}
  251.                     <a href="{{ url('cm_blog_pro_page_list', {categories: [Category.getId()]}) }}" class="list_category_link">
  252.                         > {{ Category.getName|raw }}  ({{ blogCategoryRepository.findBy({'Category': Category})|length }})
  253.                     </a>
  254.                 {% endfor %}
  255.             </div>
  256.         </div>
  257.     </div>
  258. </div>
  259. {% endblock %}