Answers Advanced Module 4 Assessment

Hi team! Back again with a module assessment issue.

The module assessment grader says that I have failed to “Add the facets code to the restaurants.html.hbs file.” However, everything is working as it should in the staging environment as described by the instructions and everything is published.

My hunch is that it might have something to do with the

that uncommented, but I’m not totally sure, it could be anything.

Attaching the module grader.

Thanks!

Lizzie

Hi @Lizzie_Alvarado_Ford,

Thanks for posting this question! I took a look at your Restaurants HBS file and everything looks good from what I can see… Would you mind trying to recommit after adding spaces before the ending brackets on your script and markup facets lines?

It should look like:

 {{> templates/vertical-full-page-map/script/facets }}
 {{> templates/vertical-full-page-map/markup/facets }}  

Our grading logic might be looking for those specific characters.

Let me know if that works!

Thanks,
Jamie

Hey Jamie! Thanks for your help. I tried that and still no luck.

Here’s the link to the recommitted version: https://sandbox.yext.com/s/2612104/sitesgit/editor2/r/65405/b/master?session=feec6082

I still have an inkling it might be the “div”? I’m not sure though. Any other ideas?

tested my inkling about the “div” being the issue, and that wasn’t it. :frowning:

Hi,

I keep getting these two parts wrong on this assesment:

  • Update the Restaurants config file to add Facets component
  • Add the facets configuration to the communitystories.json file

Could you please provide some insight?
ID 2658711

Thanks

Hi @Juan_Bustillos

I took a look and you’re very close. For restaurants and community stories, when adding facets, make sure you don’t forget to comment in the closing div component here:

Additionally, in your communitystories.json file, I am seeing two red lines - these serve to highlight errors. In this case, you have **/ accidentally commented into the code. Make sure to always check for these red lines before committing!

Let us know if you have any further questions.

Alyssa

Thanks for the explanations! All good now!

Hey,

It seems like I’m having the same issue as both Lizzie & Juan:

image

I’ve commented in the closing but this doesn’t seem to have helped :frowning:

Here is my code for the restaurants.html.hbs file:

{{#> layouts/html pageWrapperCss="YxtPage-wrapper--mobileListView" }}
  {{#> script/core }}
    {{> cards/all }}
    {{> templates/vertical-full-page-map/collapsible-filters/page-setup }}
    {{> templates/vertical-full-page-map/page-setup }}
    {{> templates/vertical-full-page-map/script/searchbar }}
    {{> templates/vertical-full-page-map/script/spellcheck }}
    {{> templates/vertical-full-page-map/script/navigation }}
    {{> templates/vertical-full-page-map/script/verticalresultscount }}
    {{> templates/vertical-full-page-map/script/appliedfilters }}
    {{!-- {{> templates/vertical-full-page-map/script/sortoptions }} --}}
    {{> templates/vertical-full-page-map/script/facets }}
    {{!-- {{> templates/vertical-full-page-map/script/filterbox }} --}}
    {{> templates/vertical-full-page-map/script/verticalresults }}
    {{> templates/vertical-full-page-map/script/pagination }}
    {{!-- {{> templates/vertical-full-page-map/script/qasubmission }} --}}
    {{> templates/vertical-full-page-map/script/locationbias modifier="main" }}
    {{> templates/vertical-full-page-map/script/locationbias modifier="mobileMap" }}
  {{/script/core }}
  <script id="js-answersLocatorBundleScript" src="{{relativePath}}/locator-bundle.js"
    onload="window.locatorBundleLoaded = true;" defer></script>
    <div class="Answers AnswersVerticalMap CollapsibleFilters VerticalFullPageMap VerticalFullPageMap--mobileListView js-answersVerticalFullPageMap">
      <div class="Answers-content">
        <div class="Answers-contentWrap js-locator-contentWrap" role="region" aria-label="{{ translate phrase="Main location search" }}">
          <div class="Answers-resultsHeader">
            <div class="Answers-searchWrapper js-sticky">
              <div class="Answers-form">
                {{> templates/vertical-full-page-map/markup/searchbar }}
                {{> templates/vertical-full-page-map/markup/navigation }}
              </div>
            </div>
            <div class="Answers-resultsHeaderTop">
              {{> templates/vertical-full-page-map/markup/verticalresultscount }}
              {{> templates/vertical-full-page-map/markup/appliedfilters }}
              {{> templates/vertical-full-page-map/collapsible-filters/markup/filterlink }}
              {{> templates/vertical-full-page-map/collapsible-filters/markup/viewresultsbutton }}
            </div>
            <div class="Answers-resultsHeaderBottom">
              {{> templates/vertical-full-page-map/markup/alternativeresults }}
            </div>
          </div>
          <!-- Uncomment the following div if you want to include filters, facets, or sort options  -->
          <div class="Answers-filtersWrapper js-answersFiltersWrapper CollapsibleFilters-inactive">
            {{!-- {{> templates/vertical-full-page-map/markup/sortoptions }} --}}
              {{> templates/vertical-full-page-map/markup/filterbox }}
          </div>
          <div class="Answers-resultsWrapper js-locator-resultsWrapper">
            <div class="Answers-resultsContainer js-locator-resultsContainer js-answersResultsWrapper">
              <div class="js-answersResultsColumn">
                <div class="Answers-results js-answersResults">
                  {{> templates/vertical-full-page-map/markup/spellcheck }}
                  {{> templates/vertical-full-page-map/markup/verticalresults }}
                  {{> templates/vertical-full-page-map/markup/pagination }}
                  {{!-- {{> templates/vertical-full-page-map/markup/qasubmission }} --}}
                </div>
              </div>
            </div>
          </div>
          <div class="Answers-centerTop">
            {{> templates/vertical-full-page-map/markup/searchthisareabutton }}
          </div>
          <div class="Answers-stickyBottom" role="region" aria-label="{{ translate phrase="Map controls" }}">
            {{> templates/vertical-full-page-map/markup/searchthisareatoggle modifier="desktop"}}
            {{> templates/vertical-full-page-map/markup/locationbias modifier="main"}}
          </div>
        </div>
        <div class="Answers-mapWrapper" role="region" aria-label="{{ translate phrase="Map" }}">
          {{> templates/vertical-full-page-map/markup/map }}
          <div class="Answers-mapFooter">
              {{> templates/vertical-full-page-map/markup/searchthisareatoggle modifier="mobileMap"}}
            {{> templates/vertical-full-page-map/markup/locationbias modifier="mobileMap"}}
          </div>
        </div>
        {{> templates/vertical-full-page-map/markup/mobilelisttoggles }}
      </div>
    </div>
    <div class="Answers-footer js-answersFooter">
      {{> layouts/yext-logo }}
    </div>
{{/layouts/html }}

Can you see what the problem is here? :confused:

Thank you!
Ashley

Hey Ashley,

There is a closing div tag on line 37 of the communitystories.html.hbs that is currently commented out in your file. If you comment that in, I think you should be good to go.

Best,
DJ

Hey @DJ_Corbett,

Thanks for your help again :slight_smile:

I’ve just commented in the closing div tag on line 37 and committed the changes but it’s still not getting accepted :frowning:

Here is my updated code:

{{#> layouts/html }}
  {{#> script/core }}
    {{> cards/all }}
    {{> templates/vertical-standard/collapsible-filters/page-setup }}
    {{> templates/vertical-standard/script/appliedfilters }}
    {{> templates/vertical-standard/script/verticalresultscount }}
    {{> templates/vertical-standard/script/searchbar }}
    {{> templates/vertical-standard/script/spellcheck }}
    {{> templates/vertical-standard/script/navigation }}
    {{> templates/vertical-standard/script/verticalresults }}
    {{> templates/vertical-standard/script/pagination }}
    {{> templates/vertical-standard/script/locationbias }}
    {{!-- {{> templates/vertical-standard/script/sortoptions }} --}}
    {{> templates/vertical-standard/script/facets }}
    {{!-- {{> templates/vertical-standard/script/filterbox }} --}}
    {{!-- {{> templates/vertical-standard/script/qasubmission }} --}}
  {{/script/core }}
  <div class="Answers AnswersVerticalStandard CollapsibleFilters">
    <div class="Answers-navWrapper">
      <div class="Answers-container">
        {{> templates/vertical-standard/markup/searchbar }}
        {{> templates/vertical-standard/markup/navigation }}
      </div>
    </div>
    <div class="Answers-container Answers-resultsWrapper">
      <div class="Answers-resultsHeader">
        {{> templates/vertical-standard/markup/verticalresultscount }}
        {{> templates/vertical-standard/markup/appliedfilters }}
        {{> templates/vertical-standard/collapsible-filters/markup/filterlink }}
        {{> templates/vertical-standard/collapsible-filters/markup/viewresultsbutton }}
      </div>
      <!-- Uncomment the following div if you want to include filters, facets, or sort options  -->
      <div class="Answers-filtersWrapper js-answersFiltersWrapper CollapsibleFilters-inactive">
        {{!-- {{> templates/vertical-standard/markup/sortoptions }} --}}
        {{!-- {{> templates/vertical-standard/markup/filterbox }} --}}
        {{> templates/vertical-standard/markup/facets }}
      </div>
      <div class="Answers-results js-answersResults">
        {{> templates/vertical-standard/markup/spellcheck }}
        {{> templates/vertical-standard/markup/verticalresults }}
        {{> templates/vertical-standard/markup/pagination }}
        {{!-- {{> templates/vertical-standard/markup/qasubmission }} --}}
      </div>
    </div>
    <div class="Answers-footer js-answersFooter">
      {{> layouts/yext-logo }}
      {{> templates/vertical-standard/markup/locationbias }}
    </div>
  </div>
{{/layouts/html }}

Do you notice anything else here? :confused:

Cheers,

Ashley

Hey Ashley,

It looks like at some point in the editing process, the line of code representing the facet markup was deleted from the hbs file. I added it back in and committed the fix, so you can try submitting again!

DJ

That was it! Thank you so much :smiley:

Continuing the discussion from Answers Advanced Module 4 Assessment:

Hello,

I am having issues as well with:

  • Add the facets code to the restaurants.html.hbs file
  • Update the Restaurants config file to add Facets component
  • Add the facets configuration to the communitystories.json file

Hi Keith -

Took a look at your account and seeing these issues for the rules you mentions:

  1. Add the facets configuration to the communitystories.json file:

Facets are commented out in the communitystories.json file. You will need to comment them in by removing the /** and **/ around that section. (Make you customize this section to match what the steps say in the assessment instructions)

  1. Add the facets code to the restaurants.html.hbs file

I see that a large chunk of this file was commented out. Here is the section that needs to be modified (and what it should look like). I think your main issue here was that that last div needed to be commented back in

{{!-- Uncomment the following div if you want to include filters, facets, or sort options --}}
          <div class="Answers-filtersWrapper js-answersFiltersWrapper CollapsibleFilters-inactive"> 
          </div>
            {{!-- {{> templates/vertical-full-page-map/markup/sortoptions }} --}}
            {{> templates/vertical-standard/markup/facets }}
            {{!-- {{> templates/vertical-full-page-map/markup/filterbox }} --}}
          </div>

  1. Add the facets configuration to the communitystories.json file

Similar to the first point, the facets and Filter Link sections need to be commented into the config file. I noticed a comma was missing after “searchOnChange: true” and that expand was set to true.

"componentSettings": {
    /**
    "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": {
      "title": "", // The title to display above the facets
      "expand": false, // Allow the user to expand and collapse the facets
      "showMore": true, // Display a link to see more facet options within a facet
      "showMorelimit": 3, 
      "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
         "fields": {
            "c_restaurantFeatures": {
            "searchable": true,
             "searchLabelText": "Search for our features",
             "placeholderText": "Search"       
      }
  }
    },
    "FilterLink": {
      "changeFiltersText": "filters", // Text that displays by default
      "resetFiltersText": "reset filters", // Text when filters are appliterlined
      "clearSearchText": "clear search" // Text when there are no results, conducts an empty search
    }, 

I also extended the expiration of your account so you can work through this. Let me know if you are still running into issues after using these edits!

I am still having issues with #1 and 2; #3 has been resolved.

#1 is referring to adding facets code to restaurants.html.hbs file, not the community stories.json fil 0 just for clarification.

Thanks

Hi Keith,

Excuse the mistype - #3 was where I meant to refer to restaurants.json. That code snippet should resolve the problem. There was nothing glaring in your file but there may have been a very slight syntax issue. When I readded this code snippet into your restaurants.json file, the issue was resolved.

For #2, it looks like that file had lines referencing vertical-standard page layouts from the theme rather than vertical-full-page-map. I do see some of the directions for the assessment references vertical-standard so I will flag this to be updated. Otherwise, I have gone ahead and fixed the code

Feel free to submit the quiz again and it should be good to go