FREELessons: 13Length: 1.3 hours

Next lesson playing in 5 seconds

  • Overview
  • Transcript

2.4 Setting Up for the “Features” Panel Entries

We’ve completed the first panel in our site so now we can use the same essential process for the remaining panels. Up next is the “Features” panel, and in this lesson we’ll be creating the fields and entry type it requires, as well as setting up another asset source.

2.4 Setting Up for the “Features” Panel Entries

Hey, welcome back to Building Landing Pages with Craft CMS. In the last lesson we finished creating the hero panel in our landing page. And, in this lesson we are going to start creating the features panel, which is this section here. So this is gonna have two entries in it, this one and this one. The process that we'll be going through be almost the same as we did for our hero panels. So we know that we're going to need to set up an asset source because we have these images for each one of these entries. We're not going to need any of the custom fields though because we can just use the default title field and the default body field for this text. So let's get into that HT docs folder. We already have a images folder set up and now add a new folder to hold out feature images and we'll just name that feature. Now we're going to set up an asset source to connect with that folder and this is the same process that we used last time. So we go into Settings > Assets. Create a new asset source and we'll call this Feature Images. We'll set our path, Images/feature/. And then for our URL we're gonna use our base URL variable. And, then we'll copy the file system path onto the end of it. So, that's just the same thing that we did when we were setting up our asset source, for our here image. Now, we can set up a field through which uses can upload images into that folder, and SS source that we also just created. Now, even though this is only going to be one field, we're still going to set up a group for it just to make it easier to distinguish which panel different fields are associated with. We'll name it Features Panel. And then let's add a new field, we'll call it Feature Image. We're just gonna skip Instructions but you know feel free to fill in that Instruction field wherever feel like it would be useful. And then we're going to change the field type to Assets. And check All so that enables us to check our Feature Images location that we just created. I'm going to switch this to Feature Images as well. And we'll set a limit of one image per entry. And change the view to thumbnails. All right, so that's done. So now we've got our asset source in our custom field. So we can go back into our settings and choose Sections. And then inside our Home Panel Section, we can create a new entry type for our Features Panel. So we're gonna go into the editing area for entry types and then we're gonna choose New entry type. For this one, let's just call it Feature and then we're gonna leave Show the Title Field checked because we're gonna use that title field to supply a title for this part of our layout. Then we'll create a new tab, we'll rename that and call it feature. So I've got a title already, we're just going to use the default body field and then that will add our feature image field. So we'll save that and now that's our second entry type all ready to go. You can see how that was pretty much the same process as with the hero panel. So once you've kind of done this once or twice it's fairly smooth sailing to do it again for different purposes. In the next lesson, we're gonna go through and we're gonna add a couple of entries. So that we have two feature entries that look like these two here. And then we're gonna create the template to make it appear on our front end below our hero panel. So I'll see you in the next lesson.

Back to the top