This article will walk you through a basic example of importing content into Agility CMS. For this example, we will be importing posts.
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.
This model will have a simple title field.
Be sure to initialize Content to use this 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.
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:
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: