forked from nestordedios/bolt-theme-kuhn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.twig
115 lines (95 loc) · 5.81 KB
/
search.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{% extends 'partials/_master.twig' %}
{% block bodyClass %}search search-results hfeed archive-view{% endblock %}
{% block main %}
{# This template is used for search results. If 'search' is defined,
we display an appropriate title. The 'records' array contains all of the
records matching the current query. If there are no results, the
code in the 'else' part of the for-loop is used. #}
<main id="main" class="site-main" role="main">
<header class="page-header">
{% if search is not empty and records is not empty %}
<h1 class="page-title">
{{ __('general.phrase.search-results-for-variable', { '%search%': search }) }}
</h1>
{% else %}
<section class="none-header">
<header class="page-header">
<h1 class="page-title">
{{ __('general.phrase.no-result-for-search-term', { '%SEARCHTERM%': search|escape }) }}
</h1>
<div class="page-content">
<p>Sorry, but nothing matched your search terms. Please try again with some different keywords.</p>
<form role="search" method="get" class="search-form" action="{{ path('search') }}">
<label>
<span class="screen-reader-text">Search for:</span>
<input type="search" class="search-field" placeholder="Search …" value="{{ app.request.get('search') }}" name="search">
</label>
<input type="submit" class="search-submit" value="Search">
</form>
</div><!-- .page-content -->
</header><!-- .page-header -->
</section>
{% endif %}
</header><!-- .page-header -->
{# echo kuhn_get_the_archive_navigation( 'next' ); #}
{{ pager('', 3, 'partials/prev_sub_pager.twig' ) }}
{% for record in records %}
<article id="post-{{ record.id }}" class="post-{{ record.id }} post type-post format-standard hentry">
{% if record.image is not empty %}
<figure class="featured-image">
<a href="{{ record.link }}" rel="bookmark">
<img width="905" height="555" src="{{ thumbnail( record.image, 433, 289, 'r') }}" alt="{{ record.image.title|default('') }}" sizes="(min-width: 990px) 955px, (min-width: 1300px) 966px, 95vw">
</a>
</figure><!-- .featured-image full-bleed -->
{% endif %}
<header class="entry-header">
{# TODO: Implement properly the function below #}
{% if record.taxonomy.categories is defined %}
<div class="cat-links">
{% for entryCategoryLink, entryCategory in record.taxonomy.categories %}
<a href="{{ entryCategoryLink }}" rel="category tag">{{ entryCategory }}</a>
{% if not loop.last %}, {% endif %}
{% endfor %}
</div>
{% endif %}
<h2 class="entry-title">
<a href="{{ record.link }}" rel="bookmark">'{{ record.title }}'</a>
</h2>
</header><!-- .entry-header -->
<div class="entry-meta">
{# TODO: Check function below is properly implemented #}
{# <?php kuhn_posted_on(); ?> #}
<span class="byline"> Written by
<span class="author vcard">
<a class="url fn n" href="{{ record.link }}">{{ app['twig.runtime.bolt_user'].getUser( record.ownerid ).displayname }}</a>
</span>
</span>
<span class="posted-on">Published
<a href="{{ record.link }}" rel="bookmark">
<time class="entry-date published" datetime="2017-08-10T09:58:38+00:00">{{ record.datepublish|date('F j, Y') }}</time>
<time class="updated" datetime="2017-08-10T09:59:07+00:00">{{ record.datechanged|date('F j, Y') }}</time>
</a>
</span>
{# <span class="comments-link">
<span class="extra">Discussion </span>
<a href="https://mor10.com/case-telemetry-wordpress/#comments">2 Comments
<span class="screen-reader-text"> on The Case for Telemetry in WordPress</span>
</a>
</span> #}
</div><!-- .entry-meta -->
<div class="entry-content">
<p>{{ record.teaser|excerpt('250') }}</p>
</div><!-- .entry-content -->
{# TODO: Implement function below
<footer class="entry-footer">
<?php kuhn_entry_footer(); ?>
</footer><!-- .entry-footer -->
#}
</article><!-- #post-## -->
{% endfor %}
{# If there are more records than will fit on one page, the pager is shown. #}
{{ pager('', 3, 'partials/next_sub_pager.twig' ) }}
{# echo kuhn_get_the_archive_navigation( 'previous' ); #}
{# get_template_part( 'template-parts/content', 'none' ); #}
</main><!-- #main -->
{% endblock main %}