Introduction

This section contains a walk-through on how to quickly enable an existing Flex Directory and how to display it within the Grav admin. In our examples we are using the Contacts Flex Directory which comes included with the Flex Objects Plugin for demonstration purposes.

Enabling a Directory

Plugin Configuration

To enable a custom Flex Directory, you need to go to Plugins > Flex Objects.

We are interested in the Directories configuration setting which lists all the detected Flex Directories. Find the directories you're wanting to enable and ensure the Enabled option is checked.

For this demonstration, let's enable the Contacts directory and click Save at the top.

After the page reloads, you should see a new item in the Grav Admin menu titled Contacts.

Install Sample Data (Optional)

For our example, we assume that you have copied the sample data set for Contacts Directory:

$ cp user/plugins/flex-objects/data/flex-objects/contacts.json user/data/flex-objects/contacts.json

Create a Page

Go to Pages and add a new page. Enter following values:

  • Page Title: Flex-Objects
  • Page Template: Flex-objects

After this you can click on Continue button.

In the Content Editor enter directory and add content:

  • Flex Directory: Contacts
  • Content:
    # Directory Example

When you are happy with the page, hit Save.

TIP: If you do not specify Flex Directory, the page will list all directories instead of displaying entries from a single directory.

Display the Page

Navigate to the page you created. You should see the following page which contains Contacts:

In case if you did not select any directory, this is what you would see instead:

Found errors? Think you can improve this documentation? Simply click the Edit link at the top of the page, and then the icon on Github to make your changes.

Results