forked from evoko/zendesk-theme
-
Notifications
You must be signed in to change notification settings - Fork 1
/
category_page.hbs
69 lines (64 loc) · 2.19 KB
/
category_page.hbs
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
<section class="section hero hero-small">
<header class="hero-inner">
<div class="hero-inner-search">
{{search submit=false scoped=settings.scoped_kb_search class="search search-full" placeholder="Search knowledge base..."}}
</div>
</header>
</section>
<div class="container">
<nav class="sub-nav">
{{breadcrumbs}}
</nav>
<div class="category-container">
<div class="category-content">
{{!-- <header class="page-header">
<h1>{{category.name}}</h1>
{{#if category.description}}<p class="page-header-description">{{category.description}}</p>{{/if}}
</header> --}}
<div class="section-tree">
{{#each sections}}
<section class="section">
<h2 class="section-tree-title">
{{#is name 'Getting started'}}
<i class="fas fa-rocket" style="color:#74BF95;font-size:28px;"></i>
{{/is}}
<a href="{{url}}">{{name}}</a>
</h2>
{{#if articles}}
<ul class="article-list">
{{#each articles}}
<li class="article-list-item{{#if promoted}} article-promoted{{/if}}">
{{#if promoted}}
<span data-title="{{t 'promoted'}}" class="icon-star"></span>
{{/if}}
<a href="{{url}}" class="article-list-link">{{title}}</a>
{{#if internal}}
<span class="icon-lock" title="{{t 'internal'}}"></span>
{{/if}}
</li>
{{/each}}
</ul>
{{#if more_articles}}
<a href="{{url}}" class="see-all-articles">
{{t 'show_all_articles' count=article_count}}
</a>
{{/if}}
{{/if}}
</section>
{{else}}
<i class="category-empty">
<a href="{{category.url}}">{{t 'empty'}}</a>
</i>
{{/each}}
</div>
</div>
</div>
</div>
{{!-- get category name and add to search bar placeholder --}}
{{#if settings.scoped_kb_search}}
<script>
var breadcrumbs = document.getElementsByClassName("breadcrumbs");
var categoryName = breadcrumbs[0].children[1].title;
document.getElementById("query").placeholder = "Search " + categoryName + "...";
</script>
{{/if}}