app/template/user_data/newslist.twig line 1

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% block main %}
  3. {%set page=""%}
  4. {%set slug="news"%}
  5. {%if "slug"|array_key_exists(get) %}
  6. {%set slug=get.slug%}
  7. {%endif%}
  8. {%set tax="category"%}
  9. {%if "tax"|array_key_exists(get) %}
  10. {%set tax=get.tax%}
  11. {%endif%}
  12. <section class="news-topic">
  13. <div class="wrap">
  14. <div class="news">
  15. {%if tax=="category"%}
  16. <h2 class="subtitle"><strong class="fadein active top"><i>N</i>ews</strong>新着情報|{{slug|get_term_by(tax)}}</h2>
  17. {%else%}
  18. <h2 class="subtitle"><strong class="fadein active top"><i>E</i>xample</strong>施工事例|{{slug|get_term_by(tax)}}</h2>
  19. {%endif%}
  20. <div class="inner">
  21. <div class="left-box">
  22. {% set content= page|wp_catelist(tax,slug) %}
  23. {%if content%}
  24. <ul class="blog-list">
  25. {%for bk , bloglist in content.blog %}
  26. <li>
  27. <a href="./news?id={{bk}}&type={{bloglist.type}}">
  28.             <div class="data-area">
  29.                 <time datetime="{{bloglist.times}}">{{bloglist.times}}</time>
  30.             </div>
  31.             <h3 class="b-title">{{bloglist.title}}</h3>
  32. {%if bloglist.digest%}
  33. <p style="font-weight: bold; color: #1A552E;">{{bloglist.digest|raw}}</p>
  34. {%endif%}
  35.             
  36.             {{bloglist.excerpt|raw}}</a>
  37. </li>
  38. {% endfor %}
  39. </ul>
  40. <div class="pagers">
  41. {{content.pager|raw}}
  42. </div>
  43. {%else%}
  44. <p style="margin: 5em 0;">ページが見当たりません。</p>
  45. {%endif%}
  46. </div>
  47. <div class="right-box">
  48. <h2>新着情報</h2>
  49. <ul class="newslist">
  50. {%set pages = ['post']%}
  51. {% for newslist in 5|wp_news_list(pages) %}
  52.     <li><time datetime="{{newslist.post_date|date('Y-m-d')}}">{{newslist.post_date|date('Y年m月d日')}}</time><a href="/information/news?id={{newslist.ID}}&type={{newslist.type}}">{{newslist.title}}</a></li>
  53. {% endfor %}
  54. </ul>
  55. <h2>施工事例</h2>
  56. <ul class="newslist">
  57. {%set pages = ['topic']%}
  58. {% for newslist in 5|wp_news_list(pages) %}
  59.     <li><time datetime="{{newslist.post_date|date('Y-m-d')}}">{{newslist.post_date|date('Y年m月d日')}}</time><a href="/information/news?id={{newslist.ID}}&type={{newslist.type}}">{{newslist.title}}</a></li>
  60. {% endfor %}
  61. </ul>
  62. <h2>カテゴリ</h2>
  63. <ul class="newslist">
  64. {%set cates =""|wp_cates%}
  65. {% for catelist in cates %}
  66.     <li><a href="/information/newslist?tax={{catelist.taxonomy}}&slug={{catelist.slug}}">{{catelist.name}}</a></li>
  67. {% endfor %}
  68. </ul>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </section>
  74. {% endblock %}