On this Craft Cms lesson you'll learn to import data from a .CSV file using a powerful plugin.
It has been the best investment I made in my design journey so far. I would consider myself a novice but I honestly feel like I've gained a genuine professional insight into the process of creating a high-level website.
I'm an early adopter of the KreativePro Masterclass, and I love how well put together it is. Neftali takes you through each step of the process from paper sketches to marketing all with fun visuals & clear instructions!
All right guys. So the next thing is to automate and import the list of actors or cast members from our webflow and we're going to do that with Feed Me, a plugin that imports CSV files. So let's go ahead and export that from webflow, click on the export button. And what that will do is it'll give us a CSB file.
I'm going to rename this CSV file to cast.csv that way we can find it a lot easier. And what I want to do is go back to our server in Fort rabbit and access it through transmit. So I'm going to open transmit, and I've already logged into the server and I'm simply going to drop the CSV file we just download it into our web root folder.
Okay. And if we click open our preview, the domain and just add /cast.csv, that's the URL of where that file is. Now notice there's an HTTPS currently Feed Me does not allow to import from local. So right now, if you just click on new feed, Then on the name add cast for the URL paste in what we just copied and select the type CSV.
We want to make sure we are selecting the type of entry and selecting the cast members as the channel. The import strategy is how you want to do this. We can look into deeper in later lessons, but we can go ahead and click the first one, which is creating new elements and for the Passkey, we can ignore that and toggle off backups.
Now this is important to have also toggled on, but for now, I just want to keep it simple. It actually adds some buffer. Makes it a little bit slower when you do that, the primary elements it's just a the default. So it's five elements in total. There's no pagination happening so we can just continue. And here's our mapping.
So notice how all these fields now have a mapping to, similar to what we saw in webflow. We're just going to add the slug, the name and everything else we're just going to leave empty because we're not mapping those entries or dates. We just want to focus on a couple of things, but you can definitely add things like author or entry ID.
That's something we'll look into later, but let's go ahead and jump into the content fields. So avatar is going to match the URL from webflow, and we're going to toggle on the create asset from URL. If it exists, then it's going to use an existing asset. All right. And then for biography, we want to map to biography and role is going to select the dropdown role and just make sure that you've selected it value in the field.
All right. So once we've done that, We can jump into what is the unique identifier? So it's going to find anything that matches that, in this case, we're going to use title. We could probably use an entry ID, but because it's coming from webflow, we don't have that, click save and continue. And boom, there we go.
Now we've created a queue it's not done yet. So what we want to do is go over to the actual Feeds and run this process. So, if you look at the locks right now, it's all empty there hasn't, nothing hasn't started yet. What I want to do is click on the Run Feed. And as soon as I do that, you'll notice on the left panel Craft starts to do some magic, starts to import all those entries and then maps them to our craft custom fields that we just created.
All right. Click on logs to see what's going on. And we're going to see. That Feed Me has created some logs that are important for us to see. So for example, in the details, we see that Joaquin Phoenix is already existing, so it founded and it skipped it because it's already there.
If I go into assets, I can see that all my files have been now uploaded to the Amazon S3 and the entries I can see that the new members are in there. Quick tip. If you double click on the little green dot a preview appears that way you don't have to actually go inside of that entry.
I think that's pretty handy. And yeah, this is great, really simple and quick way to import information.
Access our premium community including bonus tutorials, project files & weekly resources.UNLIMITED ACCCESS