Module Assessment | Yext Hitchhikers Platform

loading
You must include a first name and last name in your profile to create challenge environments.

Background

You are ready to spice up your Events and Restaurant cards! This is what you want them to look like:

Event Card with updated CTA label "Join Us"

Restaurant Card with added services list

To get your cards to look like this, you will need to follow the general steps:

  1. Fork a card using Jambo Commands
  2. Update the component.js file to customize the card settings
  3. Update the card type to the new forked card within the vertical page

Your Challenge:

Step 1: Add an Events Card

  1. Navigate to Pages > Brand Search > Deploys, go to the Code Editor, and click into the master branch. You should expect this to take a couple minutes to load – in the background, it’s starting up a container for your development.

  2. Click “View Live Preview” to open your preview in a new tab.

  3. Run a search for “events” – this is what it looks like now, which is way better than before the last module but you want to make it even more specific to the brand.

  4. You want to customize the event card so you’ll need to fork it from the theme. Go to Tools > Jambo Commands and select “Add Card”.

    • Card Name: “event-override”
    • Template Card Folder: “cards/event-standard”

    Jambo will create a new folder in the cards directory for “event-override” with a component.js and template.hbs file.

  5. Navigate to config > events.json file and update the cardType to “event-override” so that the page references the card you just created.

  6. Update your events results by navigating to cards > event-override > component.js

    • Instead of “RSVP” as the CTA label for CTA1, change it to Join Us.
    • You want the “Join Us” CTA to open the link in a new tab. Change the link target to '_blank' instead of the variable linkTarget.
  7. Click out of the code editor and wait for the console logs to say your latest build was successful. Then, go to your live preview tab and refresh the results. Make sure this looks how you want it to.

Step 2: Add a Restaurant Card

  1. You want to customize the card for Restaurants. Create another card with:

    • Card Name: “restaurant”
    • Template Card Folder: “cards/location-standard”
  2. Navigate to config > restaurants.json file and update the cardType to “restaurant”.

  3. Update your Restaurants results by navigating to cards > restaurant > component.js.

  4. You want to add the Restaurant Features field to the card. If you recall from  Data Modeling Challenge , this includes information like whether the location has live music or is pet-friendly.

    • Comment-in the services attribute.
    • Map to the c_restaurantFeatures field (hint: remove the brackets – since this field is a list-type field, you don’t need them and you don’t need to use any formatters like joinList). Remember that you reference fields from the entity with profile..
  5. Click out of the code editor and wait for the console logs to say your latest build was successful. Then, go to your live preview tab and refresh the results. Make sure everything looks correct.

  6. Commit your changes and add a commit message.

  7. Monitor the build to make sure it is successful.

Module Assessment
+<% util.points %> points
loading
Weekly Challenge Streak Weekly Challenge Streak: <% util.streakWeekly %>
You must include a first name and last name in your profile to create challenge environments.
Challenge account expires in <% util.expirationHours > 24 ? Math.round((util.expirationHours * 1.0) / 24) : util.expirationHours %> <% util.expirationHours > 24 ? (Math.round((util.expirationHours * 1.0) / 24) == 1 ? 'day' : 'days') : (util.expirationHours == 1 ? 'hour' : 'hours') %>.
Challenge account has expired. Please create a new account.
Report Card
Add an event override card and update the label
Update the link target on the event override card
Update the services property on the restaurant card
Common Issues
Are you seeing blank search results when you preview your changes? expand/collapse module

Here are some things to double check:

  • Inspect the page and check the console. See whether there are any helpful errors and refer to the Common Console Errors reference doc to see if you are running across any common errors.
  • Make sure that you didn’t delete the experienceKey out of the locale_config.json file by accident.
  • Try clicking Update Preview again and look at the Console. Do you see any errors? If not, try doing another hard refresh once the console says it is completed.
Having an issue with your new card? expand/collapse module

Here are some things to double check:

  • Do you have syntax errors? Look out for red underline and indicators on your scroll bar in the code editor for errors.

  • Are you using any slanted quotation marks instead of straight quotation marks? If you copy and pasted anything that includes quotations, make sure they don’t include any fancy slanted quotations as those are not code-friendly!

  • Make sure you included “profile.” before any fields mapped from Content in your JS. This is telling the system to pull it from the profile. For example, if you want to use the theme custom field, it should be “profile.c_theme” and not “c_theme”.

  • If you used double quotes for any hardcoded content, try using single quotes. The graders can be a bit finnicky! In general, you should be consistent with either single or double quotes in your code, but in general we prefer to use single quotes in JavaScript.

  • Make sure you spelled everything correctly and exactly as specified in the challenge! A computer is grading you on whether you did it right which means that spelling matters!

  • Make sure the card name is as specified in the challenge and that you properly mapped to it on the [pageName].json file.

  • Any formatters you use are spelled correctly. You can find the formatters and you can read about commonly used ones in the Common Formatters reference doc.

  • Space out your code for legibility. This won’t actually change your end result, but it will help others who are reviewing your code (including our auto-graders!). Think about it – which of the following is easiest to read? Hint: the second one!

    `attribute: profile.c_field+profile.c_field+' | '+' Job'`
    `attribute: profile.c_field + profile.c_field + ' | ' + ' Job'`
Previous Submissions
Attempt #<% submission.attemptNumber %>
<% submission.date %>
Score: <% submission.numericScore %>
Pending
Feedback