Import board game data into Craft CMS
In the previous lesson, we created the Board Games section. Now we’ll import our favorite board games into Craft CMS using the Feed Me plugin. We’ll use the Craft Plugin Store, configure Feed Me, import our game data & customize the admin listings screen.
Install Feed Me plugin #
We’ll install the Feed Me plugin via the Craft Plugin Store.
Click on Plugin Store.
In the Search plugins box type in “Feed”.
Click on Feed Me.
Click the Install button.
After a bit of processing time, you’ll see Feed Me in left sidebar.
Board Game CSV #
Create Board Game feed to import CSV #
- Click on Feed Me.
- Click the New feed button.
- Fill out the Name field with “Favorite Board Games”.
- In Feed URL enter: https://cdn.eaglepeakweb.com/img/projects/blog/favorite-board-games.csv
- In Feed Type select CSV.
- For Element Type select Entry.
- In Section, select Board Games.
- In Entry Type, select Board Games.
- For Import Strategy, leave Create new elements checked.
- The default values for remaining fields (Passkey and Backup) are fine. Click Save & Continue.
- The default values for Primary Element and Pagination URL are fine. Click Save & Continue.
Mapping the Entry fields #
Now we’ll map the CSV columns to Craft entry fields.
- Map Title to
- Leave the remaining fields as Don’t Import.
Mapping the Content fields #
Next we’ll map the CSV columns to Craft content fields.
- Map Board Game Image to
<Photo>. Check [✓] Create asset from URL.
- Map Board Game Category to
- Map Difficulty to
- Map Minimum number of players to
- Map Maximum number of players to
- Map Best number of players to
- Map Minimum Duration to
- Map Maximum Duration to
- Map Play Online to
- Leave the Title as the unique identifier. Click Save & Continue.
- You’ll see a message that the import has been queued up.
- Click on View feeds.
Run feed to import board games #
Moment of truth. Time to run the feed and import the board game data.
- Click the Run feed button.
- You’ll see notification that feed is running.
- Once the import has finished. Click on Entries.
- Success! 🎉 Our board games have imported correctly.
Customize Board Games admin listings #
We’ll finish this lesson by adjusting the columns on the board games index. I’d like to see the board game image & remove Expiry Date.
- Click on the gear icon ⚙️.
- Uncheck the Expiry Date.
- Check Board Game Image and drag it up.
- Click Save.
Hide Image Labels #
I don’t like the redundant titles after the images. So I’ll hide them.
- Go to Settings.
- Click on Fields.
- Click on Board Game Image.
- Scroll down to Preview Mode and change it to Show thumbnails only.
- Click Save.
If you return to the Board Games entries screen it’ll now look like this: