DreamweaverFAQ.com
Search the site!Search DWfaq.com | Print This PagePrinter Friendly Page
Current: Default | Default: ZOot3


DreamweaverFAQ.com » Tutorials » Basics » Repeating Regions In Templates - Part One


Q. What does the repeating region in a template do?

A. It allows us to add and order content within our templates.

Repeating regions- Part One

The repeat region template option.

We can use the repeating region to control the layout of sections of our page that need to be repeated. There are two types of repeating region within Dreamweaver MX that function as part of your template, these options are:

The repeating region and the repeating table.

So what is the difference between the two?

The repeating region does not include an editable region by default but you can insert an editable region into the repeating region if you wish.

The repeating table option lets you define the table and gives you the option of creating the editable regions within that table, and it also allows you to define which rows are taken into the repeating region.

That's the basic idea of the repeating regions, we'll look at the repeating region in this tutorial and cover the repeating table in a separate tutorial a little later.

The repeat region.

To begin with we can download our basic pre-set template from here. I will assume you have set up your site in Dreamweaver MX and have your pre-designed template open and ready in your Dreamweaver MX work space. Now we can begin.

Lets look at what we have. In the image below we can see our editable "Content" region, above this we have an empty table row and above that we have what could be a title for this section of information; the information we will create with our repeating region.

Start with en existing template

 

Lets type some text into the empty cell, anything you like will do. When you have done that click inside the table cell and select the <td> tag from the tag selector at the bottom left of Dreamweaver MX as shown below.

The Tag Selector

 

Now we can click the "Templates" tab on the Insert Panel and select the "Repeating Region" icon as below.

 

This will produce a dialog box, we can accept the defaults as below and click ok

New Repeating Region dialog box

 

Our table cell is now wrapped in the "Repeating Region" as below, save the template and close it.

A repeating region is indicated by a "Repeat: Region Name" tab.

 

Select F11 to open our Assets Panel, right click the template and select "New From Template" from the list as shown below.

Select New from Template in the Assets panel context menu.

 

This will create an instance of the repeat region template. You should immediately notice the controls as shown below, we haven't seen anything like this in a template before!

A page derived from a template has Repeat Region is indicated by a tab with controls.

 

We now have a repeating region, but it isn't editable yet so lets move on and give the "Repeating Region" editable content and then we can look at our controls and how they work.

Close our template instance without saving it.

Reopen the "repeatregion" template by using the shortcut F11 and double clicking the template in the lower part of the Assets Panel.

Click inside our "Repeating Region" and reselect the <td> tag from the tag selector at the bottom left of Dreamweaver MX as we did when we added the "Repeating Region". With the <td> tag selected go to your "Templates" tab and from the Templates options select the "Editable Region" icon.

Editable Region object

This will insert an "Editable Region" within our "Repeating Region". This makes the "Repeating Region" editable which provides us with the ability to edit each section of the "Repeating Region" as we require. We can now save our template and close the document leaving the Dreamweaver MX work space empty.

::This page last modified 8/13/2013 at 04:37::

Copyright © 2001-2024 DreamweaverFAQ.com All Rights Reserved.
All brands, trademarks, tutorials, extensions, code, and articles are the property of their respective owners.
A production of Site Drive Inc.
Legal Notice | Privacy Policy | Disclaimer & Notice