Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m
by
Lessons:33Length:3.7 hours
Drupal 8 1
  • Overview
  • Transcript

5.1 Creating the Conferences Content Type

Creating a good site starts with designing the content you will be working with in the site interface. In this lesson, we'll create our first content type to model the concept of a developer conference. Along the way, we'll see a few new types of fields.

5.1 Creating the Conferences Content Type

As you can see here I have basically reset my site back to the very beginning. And really all I did was deleted my content and got rid of my custom content types. And kind of reset all the basic settings that we've been playing around with a little bit back to their default. So I'm starting with a clean slate here. Now for the remainder of this course we we're going to walk through step by step. The process that I would go through in creating a very basic production level site from scratch with Drupal. Now along the way I'm going to give you plenty of little tips and tricks here and there. And even introduce some new things that we didn't cover in the beginning of the course. But the idea here is to take an idea and start to build it out in Drupal. To see how you can do that and then be able to extend it with any sort of additional ideas that you might have. So as you kind of noticed at the very beginning of the course. What we're looking to actually start to build here is a development conference tracking system. It's basically the idea that I'm going for. So there's of wide variety of different topics and things that you can do in a site like this. But we're gonna kind of boil it down to the very basics. So we're going to build out some of that functionality and then show you some extension points. I feel like you might be able to take on, on your own after following along with a basic course like this. So typically what I like to start with when I'm building a site like this with Drupal. Is I want to build out my custom content types. And since we've already learned a little bit about that, let's go ahead and dive right in. So I'm gonna come into structure. And I want to go into content types and I want to start to build out my own. So, let's click Add content type. And for this type of a site there are a couple different content types that I want to start with. I want to start with a concept of a conference. And I want to start with the concept of a user group or maybe a sponsor. Or something along those lines, whatever sort of terminology you feel comfortable with. And beyond that you can even get down into speakers and all sorts of things like that. But once you get to that point I wanna let you go ahead and enhance it a little bit more if you so choose. So the first content type that we're gonna start building is going to be conferences. So I'm gonna say Conferences is gonna be the name. And this is going to represent a developer conference like that. And we're gonna come down here and play around with the submission form settings here a little bit. So for the title field we're going to call this Conference name, I think would be a good name for that. For publishing options we're going to leave all of the defaults checked here. We're going to create a new revision for each ones. So, we're gonna track all the changes that we make along the way for each of the conference. For display settings in this case, I don't think it really makes much sense to show the author and date information. Because it doesn't really matter who's creating these. It's more importantly what this conference is, when it is, where it is. Those types of things and let's go into the menu settings. And this is an interesting situation. I don't actually want to add this to a menu. Because every single time then when I create a new instance or new node of a conference type. I don't want to show up in my main navigation. Now it's just gonna get incredibly long and that doesn't seem to make much sense to me. So let's go ahead and save and manage fields for our conferences content type. So the first thing that we have here is the body which we do wanna keep. But I think we might wanna edit this just a little bit, so we can come in here and select Edit. And at this point I don't really wanna call this Body. Maybe I wanna call this Conference Description like that. And we can give this some Help text if we want. I don't think that's absolutely necessary. Is this is going to be a required field? Yes, I think we should probably put some sort of information in there to describe what this conference is about. So, let's make that required. I don't think we need default. Ad summary input, this will allow us to be able to explicitly put in a summary? Yeah I think we should keep that in there too. So, let's go ahead and save those settings. So now we have our conference description. Let's go ahead and add in some additional fields here now. So one of the other important things that we're going to need to know about a conference is when it is. So let's go ahead and come in and we're going to add in a date. And the date here is going to be a conference date. Cuz we want to know when this is going to take place. And we're going to use date and time. I think for this date only should be sufficient. We're not gonna get into too much detail, but you can obviously play around with it a little bit. And we only want to allow one value because this is only gonna have one start date. So we're gonna Save field settings for that one. And now we may want to add in some help text, I think we're okay with that. Required, yeah I think this should be required. We should definitely have a value in there. Default date, I don't think that's necessary and we'll click Save settings. Now, remember as I'm going through these and creating these rather quickly. Because to this point you should be familiar with creating these content types and adding fields. But please feel free to go back and make changes to these however you see fit. So let's go ahead and add another field, and this time we might want to have a logo for this type of a content type. So we can come down here, and we want to be able to add an image, and this is going to be the Conference Logo. Let's click Save and continue. And here we want to place all of these that files that are uploaded into our public files. That should be fine. And then we can set some defaults here. We can set a default image, our default alternate text, default title. I don't think that's necessary. Those things should be added in as we upload the data and there should only be one. So let's save those fields settings. Now we can come in here and give help text if we want. Required fields, I don't think we have to have a logo. It might be good to do it but I really don't think it should be required. And then we can come down here and allow file extensions the defaults are typically going to be fine. I think those four are going to cover most things that we need. Now, when you come down here to the resolutions. I think it's important to think about these a little bit and try to plan for the lowest common denominator. You have to remember that the visitors to your site are not all going to have very large bandwidth. They might be reading or going to your site from mobile devices, over cellular data. So, they might not always have the biggest download capacity, so don't just allow any sort of uploading. You don't wanna be able to upload 30 meg files or something like that. And really run into problems for people that are trying to view your site. So it's probably not a bad to limit some of these resolutions. So maybe let's say the maximum image resolution should be maybe 800 by 800. Minimum resolution, because this is important. If you don't specify a minimum, then what could probably happen is some smaller images could get uploaded. And then there could be problems with trying to stretch out that image to show it on the screen for your content type. And things get a little pixellated. So let's say maybe the minimum resolution needs to be 100 by 100, something like that. And then providing a maximum upload size is probably not a bad idea. So maybe the the maximum upload size is maybe 100 kilobytes or something like that. You can obviously tweak this a little bit to handle your specific situations, but these are probably some decent things to begin with. Now we do want to enable the Alt field obviously for screen readers and we should make the Alt field required and I think that is good. So let's go ahead and save those settings. And then finally at least for now we're gonna come back and edit this a little bit more in an upcoming lesson. But we want to create a link. Because we want to be able to send the user off to these specific conference website to get additional information. So we're gonna call this the conference website. Let's Save & Continue. And in this case there's not a whole lot of tweaking here. We're going to limit this to one URL. Cuz I'm assuming that each conference is only gonna have a single URL. Let's Save field settings. We can come in and set the help text. I think this probably should be required. Because you would want to be able to go out. And get additional information about this particular conference from the actual conference itself. And then you can add in some default values here which I don't think is necessary. And then down here on the bottom we have allowed link type. So we have internal, external and both. Meaning internal links are only going to be links that are found within our Drupal site. Which probably doesn't make sense in this case. But it might. We might want to reference something internally. And then external links means I want to be able to go out to external links to external websites or you can do both. So in this case I think both probably makes the most sense. And then Allow link text. So do we want to provide a label? When we are adding in this text field or this link field. I don't know, maybe, so let's go ahead leave that optional leave that up to the user. That's creating these conferences, these nodes as they go along with our site. So let's go ahead and Save settings here. So here are the first four fields that we have added to our new content type. And I think that's gonna be fine to get started with. And we're gonna come back in a in a couple lessons and actually add to this. But it's gonna be something new we haven't talked about. So this is going to be our first new content type.

Back to the top