Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <section class="featured multi-pages white-bg category-listing">
- <div class="container">
- <div class="row">
- <ul class="feat-box-container">
- {% if type == "topic" %}
- {% set topicEntries = craft.entries.section('improveYourClub').relatedTo({targetElement: entry}) %}
- {% endif %}
- {# use news channel #}
- {% if type == "news" %}
- {% set topicEntries = craft.entries.section('news') %}
- {% endif %}
- {# use press release channel #}
- {% if type == "press-release" %}
- {% set topicEntries = craft.entries.section('pressReleases') %}
- {% endif %}
- {% if type == "tag" %}
- {#
- check tag docs https://craftcms.com/support/tag-urls
- and
- https://craftcms.stackexchange.com/questions/17026/use-of-tag-slug-instead-of-tag-title-in-a-custom-rout
- #}
- {# set variable for segment 3 #}
- {% set seg_3 = craft.request.getSegment(3) %}
- {# set tag = to segment 3 #}
- {% set tag = craft.tags.slug(seg_3).first() %}
- {% set topicEntries = craft.entries.section('improveYourClub').relatedTo(tag) %}
- {% endif %}
- {% paginate topicEntries.limit(10)as pageInfo, topicEntries %}
- {# https://craftcms.stackexchange.com/a/11472/193 #}
- {# {% cache globally using key craft.request.path ~ '/p' ~ craft.request.getPageNum for 2 hours %} #}
- {% for topic in topicEntries %}
- {% if topic.articleImage | length %}
- {# with post image #}
- <li class="col-sm-10 col-sm-offset-1 feat-box">
- <div class="content">
- {% set postImage = topic.articleImage.first() ?? miscellaneous.articleImage.first() %}
- {% set croppedImage = {
- mode: 'crop',
- width: 460,
- height: 295,
- quality: 75
- } %}
- <div class="col-sm-5">
- <a href="{{ topic.url }}" class="img-container">
- <img src="{{ postImage.url(croppedImage) }}" alt="Featured image">
- {% if topic.membersExclusive == "1" %}
- <img src="/assets/imgs/member-exclusive.png" alt="Member Exclusive" class="member-exclusive test-3">
- {% endif %}
- </a>
- </div>
- <div class="col-sm-7">
- <ul class="topic-breadcrumb">
- {% if topic.topics | length %}
- {% for topic in topic.topics %}
- <li>
- <a href="{{ topic.url }}">{{ topic.title }}</a>
- </li>
- {% endfor %}
- {% endif %}
- {% if topic.tags | length %}
- {% for tag in topic.tags %}
- <li>
- <a href="{{ tag.slug }}">{{ tag.title }}</a>
- </li>
- {% endfor %}
- {% endif %}
- </ul>
- <p class="header">
- <a href="{{ topic.url }}">{{ topic.title }}</a>
- </p>
- <p>{{ topic.summary }}</p>
- </div>
- </div>
- </li>
- {% else %}
- {# no post image #}
- <li class="col-sm-10 col-sm-offset-1 feat-box no-img">
- <div class="content">
- <div class="col-sm-9 col-sm-offset-2">
- {#
- <ul class="topic-breadcrumb">
- <li><a href="#">Member Retention Report</a></li>
- </ul>
- #}
- <p class="header">
- <a href="{{ topic.url }}">{{ topic.title }}</a>
- </p>
- <p>{{ topic.summary }}</p>
- </div>
- </div>
- </li>
- {% endif %}
- {% endfor %}
- {# {% endcache %} #}
- </ul>
- {% include "_includes/pagination" %}
- </div>
- </div>
- </section>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement