Help with Search Frontend Module 3

I’ve tried a couple times and I keep getting these two sections wrong in the challenge:

This is my code:

{
“verticalKey”: “events”, // The vertical key from your search configuration
“pageTitle”: “Event Search”, // !!!REPLACE THIS VALUE!!! The contents of the title tag and meta open graph tag for title
// “metaDescription”: “”, // The meta tag for open graph description
// “canonicalUrl”: “”, // The link tag for canonical URL as well as the meta tag for open graph url
// “keywords”: “”, // The meta tag for keywords
“pageSettings”: {
“search”: {
“verticalKey”: “events”, // The vertical key from your search configuration
“defaultInitialSearch”: “” // Enter a default search term
}
},
“componentSettings”: {
“SortOptions” : {
“options”: [
{
“type”: “FIELD”,
“field”: “name”,
“direction”: “ASC”,
“label”: “Event Name”
},
{
“type”: “FIELD”,
“field”: “time.start”,
“direction”: “ASC”,
“label”: “Event Date”
}
]
}
}
}
/**
“QASubmission”: {
“entityId”: “”, // Set the ID of the entity to use for Q&A submissions, must be of entity type “Organization”
“privacyPolicyUrl”: “” // The fully qualified URL to the privacy policy
},
/
/

“Facets”: {
“expand”: false, // Allow the user to expand and collapse the facets
“showMore”: false, // Display a link to see more facet options within a facet
“searchOnChange”: true // Will automatically run a search as facets are selected or unselected. Set to false to only trigger updates with an Apply button.
// Additional options are available in the documentation
},
/
/

“FilterLink”: {
“changeFiltersText”: “sorts and filters”, // Text that displays by default
“resetFiltersText”: “reset filters”, // Text when filters are applied
“clearSearchText”: “clear search” // Text when there are no results, conducts an empty search
},
/
/

“DirectAnswer”: {
“types”: {
“FEATURED_SNIPPET”: {
“cardType”: “documentsearch-standard”
},
“FIELD_VALUE”: {
“cardType”: “allfields-standard”
}
}
},
**/
“AppliedFilters”: {
“removable”: true
},
“VerticalResults”: {
“noResults”: {
“displayAllResults”: true // Optional, whether to display all results in the vertical when no results are found.
},
“hideResultsHeader”: true
},
“SearchBar”: {
“placeholderText”: “Search”, // The placeholder text in the answers search bar
“allowEmptySearch”: true, // Allows users to submit an empty search in the searchbar
“loadingIndicator”: {
“display”: true //Optional, whether to include a loading indicator on seachbar
// “iconUrl”: “” //Optional, use custom icon url instead of the default loading indicator animation
},
“voiceSearch”: {
“enabled”: false // Whether or not voice search is enabled
// “customMicIconUrl”: “”, // Path to override the voice start icon
// “customListeningIconUrl”: “” // Path to override the voice stop icon
}
},
“Pagination”: {
“noResults”: {
“visible”: true
}
}
},
// Configuration used to define the look and feel of the vertical, both on this page and, by default,
// on the universal page.
“verticalsToConfig”: {
“events”: { // The vertical key from your search configuration
// “label”: “”, // The name of the vertical in the section header and the navigation bar
// “verticalLimit”: 15, // The result count limit for vertical search
“universalLimit”: 4, // The result count limit for universal search
“cardType”: “event-standard”, // The name of the card to use - e.g. accordion, location, customcard
// “icon”: “star”, // The icon to use on the card for this vertical
“universalSectionTemplate”: “standard”
}
}
}

Thank you for your help!!

Lupillo Andazola

Hi @Lupillo_Andazola,

The SortOptions object in the events.json file needs to have the defaultSortLabel and label properties added in order to complete those two tasks on the report card. It should look like this:

image

Let me know if this helps!

Micaela

Hi Micaela,

This looks great thank you! I changed it but then I commited and can’t get back in to the code editor. I get an error message:

And the two error messages are still coming up on the report card. Do you know how to get the code editor to work? I don’t want to restart the whole challenge.

Thanks!

Lupillo Andazola

@Lupillo_Andazola,

I tried to open the Code Editor in your account and wasn’t having any issues. Can you try to open it again?

I did notice that you had a syntax error (there were extra } after your SortOptions object). This was causing an error in the live preview. I have gone ahead and fixed this for you so when you open the Code Editor you will need to terminate your current session (click Tools > Terminate Session) and reopen the Code Editor to start a new session.

I am not sure if you reverted code, but I didn’t see the defaultSortLabel and label properties in the events config page, so you will need to add those to pass the assessment.