{% extends 'default_frame.twig' %}
{% block javascript %}{% endblock %}
{% block stylesheet %}
<style>
/* .pluginCMBblog .item_blog_image {
width: 100% !important;
height: 248px;
object-fit: cover;
}
.pluginCMBblog .figure__main_image{
margin: 0;
padding: 0;
display: grid;
justify-content: stretch;
align-items: flex-end;
}
.pluginCMBblog .item_blog_image,
.pluginCMBblog figcaption {
padding: 0;
grid-column: 1/2;
grid-row: 1/2;
}
.pluginCMBblog figcaption {
text-align: center;
padding: 0.4rem 2rem;
font-size: 1rem;
background-color: rgba(0,0,0,.7);
color: #fff;
overflow: hidden;
white-space: normal;
word-wrap: break-word;
} */
.pluginCMBblog .ec-topicpath .ec-topicpath__item{
display: initial !important;
}
.pluginCMBblog .list_blog_cat li {
display: initial !important;
letter-spacing: 0.2rem;
font-size: 16px;
}
.pluginCMBblog .list_blog .list_category_link{
color: #337ab7;
padding: .2rem 0.5rem;
font-size: 1.3rem;
border-right: 1px solid #ddd;
}
.pluginCMBblog .blog_category li:last-child .list_category_link{
border: none;
}
.w-100 {
width: 100%
}
.side-bar > div {
width: 90%;
}
h5.tag-header {
font-family: Oswald;
font-weight: bold;
font-size: 22px;
color: #333;
border-bottom: 4px solid #000;
}
.month-archive a {
margin-bottom: 8px;
display: block;
color: #333;
}
.month-archive a:hover {
color: #337ab7;
}
.archive-link-div {
max-height: 600px;
overflow-y: scroll;
}
.archive-link-div::-webkit-scrollbar {
display: none;
}
.pluginCMBblog .blog-list {
padding-left: 0;
list-style-type: none;
}
.pluginCMBblog .blog-list__item {
margin: 20px 0;
display: flex;
align-items: center;
gap: 15px;
}
.pluginCMBblog .blog-list__item .blog-image {
max-width: 170px;
}
.pluginCMBblog .blog-list__item .blog-info {
width: calc(100% - 190px);
border-bottom: 1px dashed #707070;
font-size: 13px;
color: #333;
}
.pluginCMBblog .blog-list__item .blog_release_date {
display: inline-block;
margin-right: 10px;
color: #707070;
}
.pluginCMBblog .blog-list__item .blog_category {
display: inline-block;
padding-left: 0;
list-style-type: none;
}
.pluginCMBblog .blog-list__item .blog_category a {
padding: 3px 5px;
color: white;
background: #333;
}
.pluginCMBblog .blog-list__item .blog_title_h3 {
margin: 20px 0;
line-height: 30px;
}
.pluginCMBblog .blog-list__item .blog-link {
color: #333;
}
.pluginCMBblog .blog-list__item .blog-link:hover {
color: #337ab7;
}
.pluginCMBblog .blog-list__item .blog-link .chevron-right {
display: inline-block;
width: 18px;
height: 18px;
border-radius: 50%;
background: black;
text-align: center;
}
.pluginCMBblog .blog-list__item .blog-link .chevron-right .fas {
color: white;
}
/* .pluginCMBblog .figure__main_image {
box-shadow: 0px 0px 15px #888;
} */
.pluginCMBblog .figure__main_image img {
width: 170px;
height: 170px;
border-radius: 5px;
object-fit: cover;
}
.pluginCMBblog a:hover img {
opacity: .85;
}
@media screen and (max-width: 768px){
/* .pluginCMBblog .item_blog_image {
width: 100% !important;
height: 40vw;
object-fit: cover;
}
.side-bar > div {
width: 100%
} */
.ec-shelfRole {
padding: 0;
}
.pluginCMBblog .blog-list__item {
flex-direction: column;
align-items: unset;
}
.pluginCMBblog .blog-list__item .blog-image {
width: 70%;
}
h5.tag-header {
margin-top: 40px;
}
}
@media only screen and (min-width: 768px) {
.side-bar {
width: 280px;
}
.ec-role {
display: flex;
justify-content: flex-start
}
}
</style>
{% endblock %}
{% block main %}
<div class="ec-role pluginCMBblog">
<div class="w-100">
{# <div class="ec-searchnavRole__topicpath">
<ol class="ec-topicpath list_blog_cat">
<li class="ec-topicpath__item">
<a href="{{ url('cm_blog_pro_page_list') }}">{{ '全て'|trans }}</a>
</li>
{% for category in categories %}
<li class="{{category.class}}">
<a href="{{ url('cm_blog_pro_page_list', {categories: [category.getId()]}) }}" class="list_category_link">
{{ category.getName|raw }}
</a>
</li>
{% endfor %}
</ol>
</div> #}
{% if pagination.totalItemCount > 0 %}
<div class="ec-shelfRole">
<ul class="blog-list">
{% for blog in pagination %}
<li class="blog-list__item">
<a href="{{ url('cm_blog_pro_page_detail', {'id': blog.slug ? blog.slug : blog.id}) }}" class="blog-image">
<figure class="figure__main_image">
{% if blog.getMainListImage %}
<img src="{{ asset(blog.getMainListImage|no_image_product, 'save_image') }}" class='item_blog_image'></img>
{% else %}
<img src="{{ asset(''|no_image_product, 'save_image') }}" class='item_blog_image'></img>
{% endif %}
{% if blog.getFigCaption %}
<figcaption>{{ blog.getFigCaption }}</figcaption>
{% endif %}
</figure>
</a>
<div class="blog-info">
<div class="blog_release_date">{{ blog.release_date|date('Y.m.d')}}</div>
<ul class="blog_category">
{% for category in blog.getBlogCategories %}
<li class="{{category.getCategory.class}}">
<a href="{{ url('cm_blog_pro_page_list', {categories: [category.getCategory().getId()]}) }}" class="list_category_link">
{{ category.getCategory.getName|length > 15 ? category.getCategory.getName|striptags|replace({(' '):' '})|slice(0, 15)|raw ~ '...' : category.getCategory.getName|raw }}
</a>
</li>
{% endfor %}
</ul>
<h3 class="blog_title_h3">{{ blog.getTitle|length > 20 ? blog.getTitle|striptags|replace({(' '):' '})|slice(0, 45)|raw ~ '...' : blog.getTitle|raw }}</h3>
<p class="blog_body">{{ blog.body|length > 45 ? blog.body|striptags|replace({(' '):' '})|slice(0, 45)|raw ~ '...' : blog.body|raw }}</p>
<p style="margin: 10px;text-align: right">
<a href="{{ url('cm_blog_pro_page_detail', {'id': blog.slug ? blog.slug : blog.id}) }}" class="blog-link">
詳しく見る <span class="chevron-right"><i class="fas fa-chevron-right"></i></span>
</a>
</p>
</div>
</li>
{% endfor %}
</ul>
</div>
<div class="ec-pagerRole">
{% include "pager.twig" with {'pages': pagination.paginationData, 'routes' : 'cm_blog_pro_page_list'} %}
</div>
{% endif %}
</div>
<div class="side-bar">
{% set categoryRepository = repository('Plugin\\CMBlogPro42\\Entity\\Category') %}
{% set blogCategoryRepository = repository('Plugin\\CMBlogPro42\\Entity\\BlogCategory') %}
<div class="month-archive">
<h5 class="tag-header">カテゴリ</h5>
<div class="category-link">
{% for Category in categoryRepository.findAll() %}
<a href="{{ url('cm_blog_pro_page_list', {categories: [Category.getId()]}) }}" class="list_category_link">
> {{ Category.getName|raw }} ({{ blogCategoryRepository.findBy({'Category': Category})|length }})
</a>
{% endfor %}
</div>
</div>
</div>
</div>
{% endblock %}