Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
In the previous movie, we saw how we can create Repeating Regions in our pages to make it easy for us to perform repetitive tasks, in this case filling in this product catalog table. And we did that by creating a Repeating Region in our product template. But the problem that we have run into, and something that you may have thought about while we were going through this, is that the OurProducts template is actually attached to other pages, in addition to this kettlesandteapots page. Specifically, it's been attached to ordering.html and teacloudteas.html, both of which now have this catalog row Repeating Region, but neither of which need it. So, in order to make sure that these disappear from the pages that we don't need them on, yet remain on the page that we do need it on, we need to talk about creating Optional Regions. Let's go back to our template page. And I'm going to select the entire table containing my Repeating Region. With that selected, I'm going to choose Insert > Template Objects > Optional Region. This allows me to type in an Optional Region name. We'll call this "Product Table." Now we're not going to worry about the Advanced tab here.
There are lots of different things you can change in here, but 99 percent of time, you won't need this. We're just going to stay in the Basic tab. And for now, I'm going to keep Show by default checked. And click OK. So notice now my entire Repeating Region is wrapped in this If Product Table. This is an Optional Region. Let's make sure we Save our changes. It's going to ask if we want to update our files based on this template. We sure do. And now we have saved our pages. Now, if I go to one of the pages that's used in this template, like teacloudteas.html, or ordering.html, you can see they both still have that table. That's because I left that Show by default option checked, which is what I want for this page kettlesandteapots, but I don't want that on ordering.html, or teacloudteas.html. To change that, I'm going to go to the Modify menu, to Template Properties. And in here I can see the Product Table is set to a Value of true. That means that it's going to show that table. I'm going to uncheck Show Product Table. Click on OK. And it's gone.
It's still here on this page, but basically what I've done is because I set up this Optional Region, I made it possible to change this product table parameter. That's what it's called. If I save this, and go look at the Code, you can see that here's the code for that Optional Region. And you can see the name is "Product Table." The value is "false," meaning it's hidden. Just like if I go over to the ordering page, here is the table in here. If I go look at the Code again, notice its value is set to "true." If I change that to "false," just like if I go over to ordering.html, I can do the same thing.
Go to Modify > Template Properties, and just uncheck Show Product Table, which changed that value to False. Click on OK. And now that Optional Region is hidden. So here's a great example of these three pages all using the same template, but because I set up an Optional Region, only the catalog page displays that region, and the ordering, and the teacloudteas page don't display that region. So by now, you should have a pretty good grasp of what templates are capable of. It's not just a matter of setting up a simple design for a page, and then just working off that template.
But you can see templates can do much, much more, especially when you're working with Repeating and Optional regions. I'm going to go ahead and close all these pages. In the next movie, we will take a look at working with library items.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.