Importing Content

This article will walk you through a basic example of importing content into Agility CMS. For this example, we will be importing posts.

Setting Up the Content Model

To start, we'll need to create a Content Model in Agility. We can do this by going to Models > Content Models

Let's start by creating the models for our relations first.

Author Content Model

This model will have a simple title field.

Be sure to initialize Content to use this model.

Category Content Model

This model will have a simple title field so we can reference them in our Post Content Model later.

Be sure to initialize Content to use this model so we can reference them in our Post Content Model later.

Add a sample Authors and Categories which will help set up the structure of our Excel sheet export later.

Setting up the Post Content Model

Next, let's go back into the Models area to create a Content Model for the Blog Post, this will contain a Title, Slug, Date, and Content field along with Linked Content to our Authors and Categories list.

Here's what the settings will look like for your Authors and Categories Linked Content fields:

And here's how the Post Content Model will look:

Just like the Authors and Categories list, we will need to initialize a new List for our Posts using the Post Content Model.

Next, add a sample Blog Post  which will help set up the structure of our Excel sheet export later.

Once we have a sample post, we can go back to our Posts list and export our list as an Excel sheet in Regular format:

When it's finished, you can download the file that's provided to you and open it up. Once it's open, we'll be able to edit the fields in the Post, Author, and Category sheets:

Post

Author

Category

Note

if you would like to import this as New Content as opposed to overriding the test post we created, set the Agility_ContentID values to -1.

Once this is done, you can Import the Excel sheet back into Agility:

Once imported, you should see the post in your Posts list:

Import/Export Documentation

Exporting Content

Importing Content

Importing Content that contains Child Content

Using the Content Management SDK

Alternatively, you can use the Agility Content Management SDK which is the official JavaScript library for inserting, updating, managing, and importing content, pages, and media in your Agility CMS instance.

Content Management SDK Documentation