Dreamweaver - CS3

Lesson 52: Templates (7)

52/58 Lessons 

Optional Region

When the pages in your sitemap are associated with the product template, but you do not want the repeat regions from the catalog, you make use of the “optional region”.
With this option we can hide certain parts of the template.
As you see in the image below, the repetition area “product table” is displayed in a page that defines a product. In this case, the “Chokkan.html” page.

To hide the template, first open the “products” again.
Select the table in the repeating region.
Click “Insert” in the menu bar, choose “Template Objects” and click “Optional Region”.

This opens the “New optional Region” dialog.
In the space provided give the area a name. No matter what, so that you can remember which one it is.
We leave the option “Show by default” as checked and click the OK button

This places the optional region “table products” above the Repeating Region “product table”.
Save the template. When Dreamweaver asks you if it needs to modify all your existing pages that are linked to this template, click “Yes”.

We open the page again, where you want to hide products in the catalog, this was the Chokkan.html.
Click “Modify” in the menu bar and choose “Template Properties” from the drop-down menu.
In the dialog that appears, you will see the newly created optional region with the value “true”. Change this as you uncheck the box for the text “Show tableProduct”.
Click the OK button.

As you can see the repeating region has disappeared. We still see the navigation though.

You have to repeat the later, for the other pages in which you hide repeat region of the catalog.

This is just for information:

If you were to uncheck the “Show by default” in the “New optional Region” dialog, then you should tick the “Show tableProduct” in the “Template Properties” dialog to display the repeating region.

When we see the result in the Browser window, we see that everything is gone.

Awesome!
You've completed Lesson 52
START NEXT LESSON