Account Configuration | Yext Hitchhikers Platform

What You’ll Learn

In this section, you will learn:

  • How to prepare Content to use the Yext Directory Manager
  • How to configure the Directory Manager in Admin Console

Overview

Let’s start by configuring our account through the first two steps to creating a location directory:

  1. Prepare your Content
  2. Configure the Directory Manager

To start, you’ll need to set up your Content to support the new content the directory manager will need to create, including new entity types for each level and relationship fields to link entities to each other.

Then you’ll configure the Directory Manager to recognize the account setup it needs to create.

Prepare your Content

The first step to build a directory is to populate your Content with entities, entity types, and custom fields. These will be used by the Directory Manager to generate a directory for you.

This module assumes that:

  1. You created a repo using the yext pages new command per Module 1 .
  2. You selected the Locations Starter (basic) template repo.
  3. Per step 6 in Module 1 , your account is already populated with seed data.

Please ensure you have completed the steps mentioned above before proceeding.

light bulb
Note
If you wish to test the Directory Manager using your own location entities, you can use the following link to only apply DM-specific configuration files to your account, depending on your account type: ( production , sandbox ). However, we strongly recommend that you complete the module using the setup prescribed above.

Account Configuration

In your Yext account, navigate to the Admin Console (hint: use Quick Find for this). You should see the following resource files in your account under the folders below:

  • km > entity-type
    • root.json
    • state.json
    • city.json

These are custom entity types and fields that will be used by the Directory Manager in the next step. These must exist in order the Directory Manager to run successfully.

If you are going through this module using your own account data, you must ensure that you create your entity types before referencing them in a DM configuration file.

Configure the Directory Manager

Now that you have the necessary account setup, let’s go ahead and create a Directory Manager configuration in your account. Perform the following steps:

  1. In the top right section of your screen, click the Add Resource button.
  2. Click Pages > Directory Manager.
    • Name your file us-directory.json.
  3. Replace the existing contents of the us-directory.json file with the following JSON snippet. Then click Apply and follow the flow.

    {
      "$id": "us-directory",
      "$schema": "https://schema.yext.com/config/pages/directory-manager/v1",
      "name": "US Directory",
      "baseEntities": {
        "entityTypes": ["location"]
      },
      "root": {
        "entityType": "ce_root",
        "slug": "root.html"
      },
      "localization": {
        "locales": ["en"]
      },
      "levels": [
        {
          "entityType": "ce_state",
          "field": "address.region",
          "slug": "{{address.region}}",
          "fieldMappings": {
            "c_addressRegionDisplayName": "{{#regionDisplayName}}"
          }
        },
        {
          "entityType": "ce_city",
          "field": "address.city",
          "slug": "{{address.region}}/{{address.city}}",
          "fieldMappings": {
            "c_addressRegionDisplayName": "{{#regionDisplayName}}"
          }
        }
      ]
    }

This JSON object tells the Directory Manager how to construct the tree of entities in Content. Notice that it references the custom entity types and fields mentioned in the previous section.

At a high-level, this configuration defines the following:

  • Base Entities:

    • The set of entities from which the tree will be constructed. You can think of this set as the “base” of your tree. This set is determined by entity types, and optionally saved filters.
  • Levels:

    • The different levels of the tree. The DM will generate entities based on the logic specified at each level.
    • In the example above, the DM will create city and state entities based on the field values from the base entities (address.city and address.region), and create relationships between them and all applicable base entities.
    • The DM can be configured to populate a slug value for each generated entity. In the example above, each slug is powered dynamically by the address.city and address.region values from the base entities.
    • fieldMappings is an optional object that allows you to map data from the base entities to fields on your tree entities. In this example, we’re using it to map address.region (which is a US state abbreviation) into a display name. Refer to the Directory Management reference doc to learn more about the configuration schema and all available properties.
    • In the next unit, you will see how this configuration directly ties into your entity tree.
  • Root:

    • The root object allows you to generate a single entity that is the “parent” of all other nodes in the directory. This is typically used to power your index/home page. In the example above, the root entity would be the direct parent of all state entities.
  • Localization:

    • The set of language locales that should be constructed for your directory entities, when applicable. Refer to the Multi-Language section of the Directory Management reference do for more information on how this works.
unit Quiz
+20 points
Daily Quiz Streak Daily Quiz Streak: 0
Quiz Accuracy Streak Quiz Accuracy Streak: 0
    Error Success Question 1 of 2

    What is a possible set of levels for a location directory starting at the top of the tree?

    Error Success Question 2 of 2

    What type of Content content do you need to set up for the Directory Manager to set up levels?

    Way to go, you passed! 🏁

    You've already completed this quiz, so you can't earn more points.You completed this quiz in 1 attempt and earned 0 points! Feel free to review your answers and move on when you're ready.
1st attempt
0 incorrect