Build Your Own Business Website header image

Community Library Website Case Study- Part 11 – Importing Existing Data to the Website

Difficulty Level -

Filed Under Topics - , ,

Listed Under Lesson Subjects - ,

Applies to - ,

Whoops, you've found some premium content!

Watch the opening clip of this video to preview it,
the full video is available to paid members.

This is the eleventh in a series of live lessons on using WordPress and Thesis as a Content Management System (CMS). We are using the CSV Importer plugin to import an existing database from a CSV file. The first step in doing this is to arrange the data in a way that the plugin can understand. In this lesson we configure the data so the plugin can import it.

Video Transcript

Rick: Okay so that brings us on to Part 11 of how to… well, Part 11 is going to be how to import data and Pam has given me an updated data list which has acquisition date, barcode, media, circulation time, audience, location, call number, ISBN, publication date, topics as 1, 2, 3… 3 potential topics, author, title, subtitle, and summary. And this is in an Excel spreadsheet.

Now, what we need to do here is first, we need to prepare the data. The 2nd thing we need to do is import the data and in order for us to import the data, we need a plugin. Now, I have tested several plugins yesterday and finally arrived at the plugin that I think we should be using for this. And this plugin is called CSV Importer. And so, that’s what you should search for… CSV importer and install that. And then once you’ve done that, you can open up CSV Importer over here and all you have to do with this is choose the file, upload it, import it and see what happens. Now, the problem with doing that is you’re going to have errors. And so, that’s why we have to work on the data and so in order for us to work on the data, I want to bring up their help file. And they have a little help file that you can see in the plugins editor. And if we come over to CSV Importer and select that, you’ve got this CSV Importer Read Me text and so… this is a great way… well, this gives you access I think to this… to information that you need because once this thing’s installed, what you have to do is use specific tags at the head of each of your columns depending upon what kind of element you’re using. And so for example, we have title. It’s really going to be the title of the post and so if we look back over here at the Read Me text, you can see that the title of the post should have CSV post title at the top of the column. So we’re going to copy that, come over to here and paste it… enable editing, pardon me. Come over here and paste it and now, that’s the name at the heading. Then we’ll have to do this same thing for post… CSV Post post, copy that, come back over here… that’s the summary… CSV Post post.

And the next thing it wants is a post type so it says CSV post type and in our case, the post type is a custom post type called catalog item. So we need to create that. We’ll come over here and insert a column… I guess it’ll automatically insert the column. Put that title at the top, CSV post type. Now we need to put the actual post type in here. So we come over to this for just a moment, come back down to Manage Post Types… open link and a new tab. This post type is called catalog items. So lower case, with a hyphen in between. So that’s what we’re going to use. Catalog items and now, we need to copy this across the entire database. It should take a moment. Okay, there we go. So now we have added catalog items to our database, for all of these things.

So now you’ve got our post type and let’s see, let’s look at our taxonomies while we’re at this. So Manage Taxonomies, we have a taxonomy called media type, location, topics, audience, and author. We’ll take the first one as… well, we’ll just…media type will be the first one we’ll put in and that’s here. Now if we go back and look at the directions, scroll down here to the bottom, you can see these got stuff about let’s see… about custom taxonomies. And you know, these directions aren’t as clear as you’d like them to be so I’m going to show you how they work. But the first taxonomy that we’re doing is, I believe, what did we say it was? It was hierarchical and it’s media type.

So a hierarchical media type starts off with… which was did it go? Okay, it starts off with CSV text. Come back over to this media, CSV text and then media. So that’s the name of the custom taxonomy. So CSV text media and then the same thing is true with circulation time, right? It’s… oh no, circulation time is not a… I’m sorry, I take that back. Circulation time is not a taxonomy but audience is a taxonomy. And so, we’re going to put CSV text and then lower case audience. And location is a taxonomy so we’ll paste CSV text small location. And Pam’s got her hand up. Yes, Pam?

Pam: I thought in your taxonomy, it was media-type. So that would need to be in the column head. Is that correct? In column D?

Rick: Well, if that’s correct, yes it will. Let’s see. Yeah, that’s what it is. Media type, you’re absolutely right. This is one of the reasons why it took me so long to get this right the first time. Okay, where do we go? Back to this… so this is media-type, okay. So then, let’s see…we are not going to change these ones yet but author, we are going to change. It’ll be CSV author and I think that’s it.

Okay and so then the next ones are… setting aside topics for a moment because we have to do some special preparation for the topics. But our next ones are the custom post meta. And so again, the custom post meta needs to be the correct name here so we’re going to come to meta boxes. And so we’ve got barcode, call_number, ISBN, publication_year, and circulation_time.

So let’s come back over here. Okay, we’re going to… this one actually is a custom post meta and we haven’t established it yet. So acquisition… I don’t even know if I can type anymore. Acquisition time or acquisition date actually… date and then barcode is just barcode. Circulation time is… if you see me misspell something, by all means, please remind me here. And let’s see, what was call number? It’s call_number. ISBN is ISBN. Let’s go back over to this custom taxonomy for a second. Publication year… you know, this is a little funky because actually, this is not in a year… this is actually in a date format. But publication_year… and then we come over here and we’re going to say subtitle. Okay so now we’ve got all of those fixed. Now what we have to do is some tricky…

0 Comments… add one

Save $200 on Membership Now!

Start learning today for as little as
$0.82 PER DAY!
Subscription Options
0 comments… add one

Leave a Comment