7 days of unlimited WordPress themes, plugins & graphics - for free!* Unlimited asset downloads! Start 7-Day Free Trial
FREELessons: 11Length: 46 minutes

Next lesson playing in 5 seconds

  • Overview
  • Transcript

2.4 Creating a Section

Sections are at the top level of content organization in Craft CMS. Let’s set one up and go through how they work.

2.4 Creating a Section

Hey welcome back to up and running with Craft CMS. So far, we've gone through all of the core concepts of working with Craft CMS's content. Now, we're gonna start stepping through a basic example. We are gonna keep things fairly simple because we have another course coming up after this one where we're gonna build an entire landing page from scratch, and we're gonna get into quite a bit of detail in that course. So, what we're gonna do with the rest of this course, the idea is just to give you some practical examples of how to apply everything that we've gone through in the first half. So all we're gonna to be doing is setting up a simple About Us page with a custom image displayed on it. We're not gonna worry too much about how it look. We're just gonna work with the default CSS that comes with a cross CMS installation out of the box. So, the focus is just to get an idea how you work with the settings that are available in the backend, and we're going to get some of the basics of templating down, and then in the next course that's when we're really gonna get into some detail. So this lesson, we're gonna start by setting up a custom section. To do that, you're gonna select Settings on the left here and then you're gonna select Sections. Now up in the top right, you're gonna select New Section. So we'll give our section a name. In this case, we know we're making an About Us page. So, we're gonna name it About Us. Next, we're gonna choose the section type that we wanna use for this section. By default, it's set to channel, but that's not gonna work for us because all we want is one single About Us page. So, for that reason we're gonna choose the single section type. You'll notice that when we change the section type, the rest of the information that we have to fill out also changed. So make sure that when you're setting up a section, you choose the section type as early as possible so you don't find yourself accidentally filling in fields that you don't need to. So this has automatically given us a URI that will be used to represent our About Us page. Now you can change that URL if you need to to something else, but that's gonna work for us. And that's also automatically filled in this entry template field. So right now, based on what's filled in in this field, the system is going to look for a template named about-us.html. And later on, we're gonna create that template. Now if you need to have your template named something other than what's automatically filled in here, there's no problem with changing that to anything that you need. So then that's it. We're ready to save our section. And now, it's set up and it's ready for use. And that's all you need to do any time that you have to set up a section. Just jump up into the right corner here. Hit that new section button. Make sure you select the appropriate section type and fill in all the fields. Now I mentioned earlier that in this About Us page that we're setting up, we're gonna have a prominent image displayed inside our About Us template. And in order to do that, we're gonna set up an asset source. Another one of the really cool things about Craft CMS is you can set up exactly where assets are located inside your site installation, and that way you can control exactly where things like images get uploaded to. And we're gonna go through how that's done in the next lesson. So I'll see you there

Back to the top