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

5.2 Creating the User Groups Content Type

Developer conferences would be nothing without sponsors. So in this lesson, Derek will take you through the process of designing a User Group content type that will model the concept of a sponsor for the conferences.

5.2 Creating the User Groups Content Type

In the previous lesson we created our first new custom content type and that was conferences. Now in this lesson we wanna create another one. Because typically when it comes to conferences there are certain sponsors. And a lot of times those sponsors could be corporations or user groups or whatever. So you could try to make this is general as possible or as generic as possible. But in this case I think I'm gonna start with a basic idea. And then once again you can kind of modify this a little bit as you go however you see fit. But I'm gonna call this next one maybe user groups. And I'm gonna say that a conference can be sponsored by a user group and or multiple user groups. And user groups can sponsor one or more Conferences. Now, if you have done any sort of other development before or done any sort of database design or development. Then that sounds a little bit like a Many to Many relationship. And if it does keep that the back of your mind. Because in the next lesson we're going to talk about how we can tie all of these things together. So, let's go ahead and add another content type and let's give this one a name. Let's call this User Groups and we can give this a description, A content type to describe a particular user group. So this could be user groups for languages, or frameworks, or technologies, in certain areas or whatever have you. Or something along those lines. And then in here we can call this a Group Name, will be the title field label, we'll make that optional. So then for publishing options again we'll leave the defaults here. So we can track the changes using the Create new revision. Display settings, once again, just like we did for conferences. We're not worried about the author and date information. And menu settings once again, don't think we really want those things found within the main navigation. So let's go ahead and save and manage fields. And then we can start to build this out a little bit. Once again I'm going to edit the label here a little bit because body once again doesn't make quite as much sense. So let's just call this Group description. So we can put some information in here about the group in and of itself. And we wanna make that required. It's probably not necessary to make that required. But you can once again do it if you want. And I think maybe for this case will do it just so that we have some data in there. When we start to build out our site we can see what it looks like. We'll enable the summary and put that's fine. So do Save Settings, and that looks pretty good for the group description. Let's try to add a couple additional fields. Now like we did before, we are going to want to add a link. Because we want to be able to link to, some other information about this particular group. And we'll call this the Group Website. And we'll save and continue and in this case I think one is going to be sufficient. Because we're only gonna really want to link to one page. And a group website is good, help text is good, required field probably a good idea. And then we're going to come down here. And odds are if we're talking about an external group we're probably only going to be linking to external sites. So you could possibly change this to be external links only. Yeah, let's go ahead and do that, let's go ahead and change that to external links only. And once again we'll leave the Allow link text optional. So we can leave it up to the person that's actually inputting this information. So there's our group website, let's add a little bit more here. Let's go ahead and add a group email. So maybe we can email the person in charge of this or where can we send additional inquiries about information. So let's jump in here. We're gonna say this is going to be an email and we'll call this the contact email address or Contact Email. So let's do Save and continue and we're just going to limit this to one. We'll save Field settings. We can come down here and make this required. That's probably a good idea, and we could put in a default but I don't think that makes too much sense at this point. So we'll save settings so we have that in there, that's good. Let's add a little bit more here. How about some additional contact information? So we're going to come in here and reuse a different type that we haven't used so far down here In text. I think we'll come down and do Text (plain). That will give us a little bit more free form information for us to input some some information. We can call this the group contact, maybe so we can put in maybe a person's name or some additional information. We'll do save and continue. Max length 255, that's fine. We'll just allow one that should be fine as well. And we will make this required and we can do Save settings once again. So now we have e-mail, we have the group contact, we have group description, group website. And let's add in another field here just to spice things up a little bit, another one we haven't used yet. So let's come back in here once again, we'll come down to the bottom and let's do List (text). So List (text) is good if you want to provide some other additional information about this content type. And provide some options like a list of pieces of information or descriptions maybe about this particular user group in this instance. But whatever sort of content type you're dealing with. And let's call this actually Experience. So maybe there are specific user groups that have different types of experience, like dealing with certain types of users. Maybe they are more advanced or beginner or what have you or something like that. So let's go ahead and do Save and continue. And then we're going to come into Allowed values list. So, we can call this any number of things but let's throw a couple in here. Let's say begin to beginner, intermediate and advanced. So that should probably be good for now. And down here at the bottom what we want to do is really going to change this to Unlimited. Because there could be user groups that support all different kinds, it could be beginner, intermediate, advanced. They could do all three of them or maybe subsets of those or what have you. And you want to be able to support all of those different combinations. So we'll go ahead and do Save field settings here. We can do the Help text again, do we want this to be required? Probably, I think that's good information to know. And let's go ahead and Save settings once again. So now we've gotten to the point here, where we have our basic layout of this new content type for user groups set up. And we're at a pretty good spot now, but as I said before we wanna be able to tie these things together. The whole concept of if I were to go back in here so you can see our content types. I want to be able to tie together Conferences in user groups, because maybe you have sponsors, maybe you have something like that. And also additionally maybe we have speakers. And that's another thing that I want to build out in the next lesson.

Back to the top