Skip to content

Commit 27d986f

Browse files
mmoya064ouafaaetta
andauthored
Minor - Search results: Adding search results reference implementation (#2614)
Co-authored-by: ouafaaetta <122900545+ouafaaetta@users.noreply.github.com>
1 parent 9141ff4 commit 27d986f

23 files changed

+1695
-809
lines changed

_data/templates.json

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,7 @@
14701470
"en": "Search templates",
14711471
"fr": "Gabarit pour les pages de recherche"
14721472
},
1473-
"modified": "2022-07-06",
1473+
"modified": "2025-07-28",
14741474
"componentName": "search",
14751475
"status": "stable",
14761476
"pages": {
@@ -1506,6 +1506,49 @@
15061506
"title": "Contextuel",
15071507
"language": "fr",
15081508
"path": "results-contextual-fr.html"
1509+
},
1510+
1511+
{
1512+
"title": "Did you mean",
1513+
"language": "en",
1514+
"path": "results-did-you-mean-en.html"
1515+
},
1516+
{
1517+
"title": "Voulez-vous dire",
1518+
"language": "fr",
1519+
"path": "results-did-you-mean-fr.html"
1520+
},
1521+
1522+
{
1523+
"title": "Error",
1524+
"language": "en",
1525+
"path": "results-error-en.html"
1526+
},
1527+
{
1528+
"title": "Erreur",
1529+
"language": "fr",
1530+
"path": "results-error-fr.html"
1531+
},
1532+
1533+
{
1534+
"title": "No results",
1535+
"language": "en",
1536+
"path": "results-no-results-en.html"
1537+
},
1538+
{
1539+
"title": "Aucun résultat",
1540+
"language": "fr",
1541+
"path": "results-no-results-fr.html"
1542+
},
1543+
{
1544+
"title": "Advanced search template",
1545+
"language": "en",
1546+
"path": "advanced-search-en.html"
1547+
},
1548+
{
1549+
"title": "Résultats avancés",
1550+
"language": "fr",
1551+
"path": "advanced-search-fr.html"
15091552
}
15101553
],
15111554
"docs": [

sites/theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202

203203
// Template
204204
@import "../templates/pagebrand/base";
205-
@import "../templates/search";
205+
@import "../templates/search/search";
206206
@import "../templates/home/base";
207207
@import "../templates/blog";
208208
@import "../templates/social-media-centre/base";

templates/_search.scss

Lines changed: 0 additions & 84 deletions
This file was deleted.

templates/search/_search.scss

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
//
2+
// Search template
3+
//
4+
.page-type-search {
5+
.alert {
6+
margin-top: 30px;
7+
}
8+
9+
.current {
10+
font-weight: 700;
11+
}
12+
13+
.results > section {
14+
border-bottom: solid 1px #000;
15+
margin-bottom: 1.5em;
16+
padding-bottom: 1.5em;
17+
18+
cite a {
19+
color: #1b6c1c;
20+
display: inline-block;
21+
font-size: 1em; // 20px
22+
margin-top: 10px;
23+
}
24+
25+
.context-labels {
26+
font-size: .8em;
27+
list-style: none;
28+
padding-left: 0;
29+
30+
li {
31+
background-color: #5e738b;
32+
color:#fff;
33+
display: inline-block;
34+
font-weight: $bold-weight;
35+
margin-bottom: 1px;
36+
padding: 0 5px;
37+
}
38+
}
39+
40+
h2 {
41+
font-size: 1.1em;
42+
}
43+
44+
h3 {
45+
font-size: 1.375rem;
46+
}
47+
48+
.location {
49+
color: #1b6c1c;
50+
padding-left: 0;
51+
52+
li {
53+
display: inline-block;
54+
55+
+ li:before {
56+
content: "> ";
57+
}
58+
}
59+
60+
cite {
61+
font-style: normal;
62+
}
63+
}
64+
65+
.location li, cite a {
66+
word-break: break-word;
67+
}
68+
69+
p {
70+
font-size: 1em;
71+
}
72+
}
73+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
{
3+
"title": "Advanced search page for Governement of Canada using Headless",
4+
"language": "en",
5+
"altLangPage": "advanced-search-fr.html",
6+
"pageType": "search",
7+
"pageclass": "page-type-search",
8+
"dateModified": "2025-07-28",
9+
"share": "false",
10+
"nositesearch": true
11+
}
12+
---
13+
<search>
14+
<form>
15+
<fieldset>
16+
<legend class="h3 mrgn-tp-sm">Find pages with...</legend>
17+
<div class="form-group">
18+
<label for="advseacon1">all these words:</label>
19+
<input name="allq" class="form-control" id="advseacon1" maxlength="100" data-fusion-query="safe" aria-describedby="gc-pi">
20+
</div>
21+
<div class="form-group">
22+
<label for="advseacon2">this exact word or phrase:</label>
23+
<input name="exctq" class="form-control" id="advseacon2" maxlength="200" data-fusion-query="safe" aria-describedby="gc-pi">
24+
</div>
25+
<div class="form-group">
26+
<label for="advseacon3">any of these words:</label>
27+
<input name="anyq" class="form-control" id="advseacon3" maxlength="100" data-fusion-query="safe" aria-describedby="gc-pi">
28+
</div>
29+
<div class="form-group">
30+
<label for="advseacon4">none of these words:</label>
31+
<input name="noneq" class="form-control" id="advseacon4" maxlength="100" data-fusion-query="safe" aria-describedby="gc-pi">
32+
</div>
33+
<p id="gc-pi" class="mrgn-tp-md">Don’t include personal information (telephone, email, SIN, financial, medical, or work details).</p>
34+
</fieldset>
35+
<fieldset>
36+
<legend class="h3 mrgn-tp-sm">Then narrow your results by...</legend>
37+
<div class="form-group">
38+
<label for="advseacon5">pages updated:</label>
39+
<select class="form-control" name="fqupdate" id="advseacon5" data-fusion-query="safe"> <option selected="" value="">anytime</option> <option value="dateModified_dt:[NOW-1DAY TO NOW]">past 24 hours</option> <option value="dateModified_dt:[NOW-7DAYS TO NOW]">past week</option> <option value="dateModified_dt:[NOW-1MONTH TO NOW]">past month</option> <option value="dateModified_dt:[NOW-1YEAR TO NOW]">past year</option> </select>
40+
</div>
41+
<div class="form-group">
42+
<label for="advseacon7">site or domain:</label>
43+
<input name="dmn" class="form-control" id="advseacon7" maxlength="100" data-fusion-query="safe" aria-describedby="gc-pi">
44+
</div>
45+
<div class="form-group">
46+
<label for="advseacon8">terms appearing:</label>
47+
<select class="form-control" name="fqocct" id="advseacon8" data-fusion-query="safe"> <option value="">anywhere in the page</option> <option value="title_t">in the title of the page</option> <option value="url_t">in the URL of the page</option> <option value="body_t">in the body of the page </option></select>
48+
</div>
49+
</fieldset>
50+
<button type="submit" class="btn btn-md btn-primary">Search</button>
51+
</form>
52+
</search>
53+
<div class="row mrgn-tp-md">
54+
<div class="col-md-2">
55+
<a href="results-en.html">Basic search</a>
56+
</div>
57+
<div class="col-md-2">
58+
<a href="https://www.canada.ca/en/sr/st.html">Search tips</a>
59+
</div>
60+
</div>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
{
3+
"title": "Résultats de la recherche (avancés) pour le gouvernement du Canada avec Headless",
4+
"language": "fr",
5+
"altLangPage": "advanced-search-en.html",
6+
"pageType": "search",
7+
"pageclass": "page-type-search",
8+
"dateModified": "2025-07-28",
9+
"share": "false",
10+
"nositesearch": true
11+
}
12+
---
13+
<search>
14+
<form>
15+
<fieldset>
16+
<legend class="h3 mrgn-tp-sm">Trouvez des pages avec…</legend>
17+
<div class="form-group">
18+
<label for="advseacon1">tous les mots suivants :</label>
19+
<input name="allq" class="form-control" id="advseacon1" maxlength="100" data-fusion-query="safe" aria-describedby="gc-pi">
20+
</div>
21+
<div class="form-group">
22+
<label for="advseacon2">ce mot ou groupe de mots exact :</label>
23+
<input name="exctq" class="form-control" id="advseacon2" maxlength="200" data-fusion-query="safe" aria-describedby="gc-pi">
24+
</div>
25+
<div class="form-group">
26+
<label for="advseacon3">l'un des mots suivants :</label>
27+
<input name="anyq" class="form-control" id="advseacon3" maxlength="100" data-fusion-query="safe" aria-describedby="gc-pi">
28+
</div>
29+
<div class="form-group">
30+
<label for="advseacon4">aucun des mots suivants :</label>
31+
<input name="noneq" class="form-control" id="advseacon4" maxlength="100" data-fusion-query="safe" aria-describedby="gc-pi">
32+
</div>
33+
<p id="gc-pi" class="mrgn-tp-md">N'incluez pas de renseignements personnels (téléphone, courriel, NAS, renseignements financiers, médicaux ou professionnels).</p>
34+
</fieldset>
35+
<fieldset>
36+
<legend class="h3 mrgn-tp-sm">Affinez ensuite la recherche par…</legend>
37+
<div class="form-group">
38+
<label for="advseacon5">dernière mise à jour :</label>
39+
<select class="form-control" name="fqupdate" id="advseacon5" data-fusion-query="safe"> <option selected="" value=""> à une date indifférente </option> <option value="dateModified_dt:[NOW-1DAY TO NOW]"> au cours des dernières 24 heures </option> <option value="dateModified_dt:[NOW-7DAYS TO NOW]"> au cours des 7 derniers jours </option> <option value="dateModified_dt:[NOW-1MONTH TO NOW]"> au cours des 31 derniers jours </option> <option value="dateModified_dt:[NOW-1YEAR TO NOW]"> au cours des 365 derniers jours </option> </select>
40+
</div>
41+
<div class="form-group">
42+
<label for="advseacon7">site ou domaine :</label>
43+
<input name="dmn" class="form-control" id="advseacon7" maxlength="100" data-fusion-query="safe" aria-describedby="gc-pi">
44+
</div>
45+
<div class="form-group">
46+
<label for="advseacon8">termes paraissant :</label>
47+
<select class="form-control" name="fqocct" id="advseacon8" data-fusion-query="safe"> <option value="" n'importe où dans la page </option> <option value="title_t"> dans le titre de la page </option> <option value="url_t">dans l'URL de la page </option> <option value="body_t">dans le corps de la page </option> </select>
48+
</div>
49+
</fieldset>
50+
<button type="submit" class="btn btn-md btn-primary">Recherche</button>
51+
</form>
52+
</search>
53+
<div class="row mrgn-tp-md">
54+
<div class="col-md-2">
55+
<a href="results-fr.html">Recherche de base</a>
56+
</div>
57+
<div class="col-md-2">
58+
<a href="https://www.canada.ca/fr/sr/tr.html">Trucs de recherche</a>
59+
</div>
60+
</div>

0 commit comments

Comments
 (0)