This repository was archived by the owner on Nov 20, 2024. It is now read-only.
File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 21
21
< div id ="pagination "> </ div >
22
22
</ div >
23
23
24
-
25
-
26
24
< link rel ="stylesheet " href ="https://cdn.jsdelivr.net/instantsearch.js/1/instantsearch.min.css ">
27
25
< script src ="https://cdn.jsdelivr.net/instantsearch.js/1/instantsearch.min.js "> </ script >
28
26
74
72
var title_highlighted = item . _highlightResult . title ;
75
73
var title_plain = item . title ;
76
74
var url = item . url ;
75
+ var content = '' ;
77
76
// Check if we can show title, if not - at least show URL
78
77
if ( typeof title_highlighted !== 'undefined' ) {
79
78
title = title_highlighted . value ;
83
82
title = url ;
84
83
}
85
84
85
+ // Check if we have the description of the hit
86
+ if ( typeof item . _highlightResult . content !== 'undefined' ) {
87
+ content = item . _highlightResult . content . value ;
88
+ }
89
+
86
90
//TODO: fix the baseurl on the entire site then remove this:
87
91
if ( baseUrl == '/' ) {
88
92
var link = '<a href="' + url + '">' + title + '</a>' ;
89
93
} else {
90
94
var link = '<a href="' + baseUrl + url + '">' + title + '</a>' ;
91
95
}
92
96
93
- return '<div class="hit"><h2 class="hit-name">' + link + '</h2><div class="hit-url">' + document . location . origin + url + '</div><div class="hit-content">' + item . _highlightResult . text . value + '</div></div>' ;
97
+ return '<div class="hit"><h2 class="hit-name">' + link + '</h2><div class="hit-url">' + document . location . origin + url + '</div><div class="hit-content">' + content + '</div></div>' ;
94
98
} ,
95
99
empty : '<div id="no-results-message"><p>No results found.</p></div>' ,
96
100
} ,
107
111
search . addWidget (
108
112
instantsearch . widgets . refinementList ( {
109
113
container : '#tags' ,
110
- attributeName : 'tags ' ,
114
+ attributeName : 'functional_areas ' ,
111
115
operator : 'or' ,
112
- limit : 10 ,
116
+ limit : 20 ,
117
+ sortBy : [ "name:asc" ] ,
113
118
templates : {
114
- header : 'Tags '
119
+ header : 'Functional Areas '
115
120
}
116
121
} )
117
122
) ;
You can’t perform that action at this time.
0 commit comments