Start learning with our library of video tutorials taught by experts. Get started

Dreamweaver CS3 Beyond the Basics
Illustration by

Creating repeating regions of dynamic content


From:

Dreamweaver CS3 Beyond the Basics

with James Williamson

Video: Creating repeating regions of dynamic content

In our last exercise, we replaced our placeholder data on the page with dynamic data from our database, and in doing so we are now displaying our artist name and last name, and tagline and image and we are pulling all this information in from the database. It's looking exactly the way we want it to, but we have one problem. It's only displaying one record from the recordset. We actually want to have all of our artists displayed. So what we are going to do next is we are going to use in Dreamweaver it's known as a Server Behavior, and if you ever used the Behaviors panel in Dreamweaver 2 apply some JavaScript to the page, the Server Behaviors panel is very similar. It's just going to add server-side code, PHP or ASP.NET or ColdFusion depending upon what your server model is. It's just going to add that code to the page to achieve certain effects, and in this case what we'll need to do is a Server Behavior called Repeat Region.
Expand all | Collapse all
  1. 2m 3s
    1. Welcome
      1m 17s
    2. Using the exercise files
      46s
  2. 1h 23m
    1. Reviewing the Coding toolbar
      8m 42s
    2. Customizing the Coding toolbar
      9m 52s
    3. Taking advantage of Code Hinting
      7m 20s
    4. Using snippets and shortcuts
      11m 10s
    5. Using the Quick Tag Editor
      5m 18s
    6. Using Find and Replace
      9m 50s
    7. Regular expressions
      5m 39s
    8. Using Bridge with Dreamweaver CS3
      8m 28s
    9. Round-trip editing with Photoshop CS3
      3m 40s
    10. Leveraging image variables in Photoshop CS3
      7m 32s
    11. Integrating external variables into your workflow
      6m 16s
  3. 37m 26s
    1. Understanding the CSS Styles panel
      7m 59s
    2. Understanding the Cascade
      5m 50s
    3. Understanding Inheritance
      5m 8s
    4. Understanding Specificity
      7m 5s
    5. Managing CSS styles
      5m 4s
    6. Using Design-Time style sheets
      6m 20s
  4. 2h 19m
    1. Using the new CSS template pages
      5m 59s
    2. Understanding DIV tag structure and layout
      12m 0s
    3. Understanding the CSS box model
      10m 0s
    4. Using absolute and relative positioning
      8m 35s
    5. Understanding floating elements
      7m 9s
    6. Clearing floats
      7m 19s
    7. Using floats to control page layout
      3m 45s
    8. Building structure and assigning IDs
      10m 19s
    9. Applying basic styling to structured content
      11m 14s
    10. Positioning container elements
      11m 4s
    11. Enhancing layouts with background graphics
      11m 48s
    12. Creating faux columns with background graphics
      8m 55s
    13. Creating rounded corners with background graphics
      9m 17s
    14. Building navigation with CSS
      16m 57s
    15. Using Dreamweaver's Browser Check feature
      5m 31s
  5. 53m 22s
    1. Creating properly structured forms
      6m 30s
    2. Creating accessible forms
      6m 41s
    3. Using CSS to lay out form structure
      7m 40s
    4. Creating vertical columns for form elements
      7m 48s
    5. Adding user feedback
      5m 52s
    6. Applying advanced styling to forms
      8m 11s
    7. Client-side form validation
      4m 17s
    8. Validating forms with the Spry Validation tools
      6m 23s
  6. 1h 20m
    1. Understanding the Spry framework
      3m 43s
    2. Defining a data source for use in Spry
      3m 56s
    3. Creating a Spry table
      8m 8s
    4. Using the Spry widgets
      8m 11s
    5. Connecting various data sets
      4m 50s
    6. Understanding Spry widget structures
      7m 1s
    7. Applying custom styles to Spry widgets
      6m 24s
    8. Applying additional custom styles to Spry widgets
      8m 46s
    9. Controlling Spry widget behaviors with JavaScript
      6m 0s
    10. Controlling Spry widget animations with JavaScript
      9m 31s
    11. Creating effects with Spry behaviors
      4m 42s
    12. Hand-coding Spry
      9m 11s
  7. 1h 11m
    1. Creating a base template
      8m 6s
    2. Creating editable attributes
      6m 26s
    3. Creating a new page from a template
      7m 42s
    4. Applying a template to an existing page
      4m 36s
    5. Creating nested templates
      5m 24s
    6. Using repeating regions
      6m 34s
    7. Creating editable and non-editable optional regions
      6m 0s
    8. Using template parameters
      7m 26s
    9. Using template expressions
      9m 59s
    10. Using conditional template expressions
      8m 54s
  8. 54m 40s
    1. Examining XML structure
      2m 44s
    2. Creating an XML document
      9m 9s
    3. Using the CDATA structure
      5m 7s
    4. Creating an XSLT file
      4m 33s
    5. Binding data from an XML to an XSLT document
      5m 6s
    6. Inserting repeating regions into an XSL document
      5m 16s
    7. Creating a client-side XSL transformation
      2m 52s
    8. Styling a remote RSS feed
      7m 29s
    9. Creating a server-side XSL transformation
      5m 31s
    10. Writing XSL expressions
      6m 53s
  9. 1h 2m
    1. Overview of building dynamic websites
      1m 35s
    2. Installing PHP, MySQL, and Apache on Mac
      3m 22s
    3. Installing PHP, MySQL, and Apache on Windows
      3m 54s
    4. Creating a MySQL database
      3m 16s
    5. Defining a testing server and database bindings
      6m 14s
    6. Creating a database recordset
      4m 35s
    7. Adding dynamic content to the page
      5m 14s
    8. Creating repeating regions of dynamic content
      7m 6s
    9. Filtering database records
      7m 39s
    10. Using the Live Preview
      10m 22s
    11. Passing URL parameters
      4m 23s
    12. Dynamically generating links
      5m 18s
  10. 57m 9s
    1. Understanding behaviors
      5m 16s
    2. Installing additional behaviors
      3m 39s
    3. Planning to create a custom behavior
      3m 42s
    4. Examining existing behaviors
      5m 32s
    5. Building a behavior function
      7m 23s
    6. Creating an Action file
      6m 48s
    7. Enabling behavior functions
      9m 1s
    8. Initializing the user interface for a behavior
      3m 9s
    9. Loading behaviors in Dreamweaver
      6m 47s
    10. Testing and debugging behaviors
      5m 52s
  11. 27m 12s
    1. Running reports
      7m 41s
    2. Checking and validating links
      3m 40s
    3. Using cloaking
      5m 42s
    4. Using Check In/Check Out
      4m 3s
    5. Using Design Notes
      6m 6s
  12. 20s
    1. Goodbye
      20s

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
Dreamweaver CS3 Beyond the Basics
11h 10m Intermediate Sep 21, 2007

Viewers: in countries Watching now:

Covering diverse topics such as improving workflow and managing CSS styles, Dreamweaver CS3 Beyond the Basics is a hands-on course that teaches users how to move beyond standard, static websites. Instructor James Williamson explores how to increase productivity, interactivity, and accessibility with Dreamweaver. He also discusses how to extend the application's capabilities with XML and XSL. Exercise files accompany the tutorials.

Topics include:
  • Reviewing and customizing the coding toolbar
  • Understanding the CSS Styles panel
  • Using absolute and relative positioning
  • Creating accessible forms
  • Building AJAX pages with the Spry framework
  • Extending templates
  • Working with XML and XSL
  • Building dynamic content
  • Creating custom behaviors in Dreamweaver
  • Running reports
Subject:
Web
Software:
Dreamweaver
Author:
James Williamson

Creating repeating regions of dynamic content

In our last exercise, we replaced our placeholder data on the page with dynamic data from our database, and in doing so we are now displaying our artist name and last name, and tagline and image and we are pulling all this information in from the database. It's looking exactly the way we want it to, but we have one problem. It's only displaying one record from the recordset. We actually want to have all of our artists displayed. So what we are going to do next is we are going to use in Dreamweaver it's known as a Server Behavior, and if you ever used the Behaviors panel in Dreamweaver 2 apply some JavaScript to the page, the Server Behaviors panel is very similar. It's just going to add server-side code, PHP or ASP.NET or ColdFusion depending upon what your server model is. It's just going to add that code to the page to achieve certain effects, and in this case what we'll need to do is a Server Behavior called Repeat Region.

What we need to do is click on the Server Behavior panel, so you can see we already have some server behaviors on our page, just dragging dynamic text to the page, or binding attributes, or even developing a recordset like we have done. Since that is putting applications server code on our page, it's going to appear in the Server Behaviors panel. So let's click anywhere inside our artists description, anywhere inside it, it doesn't matter where. And if you look at the Tag Selector, you can see that you are inside of a div tag with the class of artist, and that's whom we're really going to focus on. So go ahead and use your Tag Selector to click on the div.artist tag.

Now this div tag is encasing all of the components of our artist description, so our first name, our last name, the photo, all inside this div tag. When you do a Repeat Region, you want to make sure that you have the element selected that needs to repeat. So we don't want to highlight inside the div tag because these elements would just repeat over and over and over inside the div tag. By choosing the div tag, the div tag itself will repeat over and over and over again for as many items as you tell it to from the recordset. So let's go ahead and apply our Server Behavior. I am going to go up to the plus symbol in the Server Behavior panel, and one of the first options right there is Repeat Region. So I am going to choose Repeat Region, and that brings up the dialog box and it's asking me which recordset do you want to use? Well, we only have one right now, which is rsArtists.

Now notice that we can show a certain number of records at a time. That's really helpful if you are doing searches and you've got a lot of data and you might not want to display it all on the page at one time, you can say just display ten records at a time, and you can actually build page sets so they can page to your data. Well, we are going to go ahead and say All records because we want all of our artists to display. So I'll go ahead and click OK. You can actually see around our div tag a tab area that says Repeat. I want to take just a moment to look at the Code view for this. So I am going to switch to Code view, and I am going to scroll down and you can see a lot of PHP code.

Now, if you don't know PHP, don't worry about it at all. You don't have to know PHP. That's the beauty of using Dreamweaver to do Dynamic Development. So we are going to go ahead and choose Save and we are going to test this in our browser. Once again it's going to ask you, if you want to update your copy on the testing server, I am going to say OK. Now I am not going to put the dependent files, we did it last time and I haven't really changed in the asset file, so I am just going to choose No there. And it will preview it in our browser and now if I scroll down, look how much work we saved to ourselves. We don't have to worry about hand coding all these, or building them on. We don't even have to build this from a template.

We are going ahead and let the database take care of this, and that is the beauty of using Dynamic Development in your workflow. It just really speeds up the process. Now everything here looks great, but there is one problem. If I click on the Bio page for Dan keys, I am still going to Aimee's Bio page, and if I click on Dan's Gallery, I am still going to Aimee's Gallery. And as nice as Aimee's gallery is, that is not what we want to have happened. So what we'll do now is we'll go back in the Dreamweaver and we are going to go ahead and modify those links, so that a portion of them are dynamically generated and they'll link to the correct page. So let's go and close out of Firefox.

And I am initially going to switch back to the Design view but we are going to perform this in Code view. So I am going to go ahead and highlight the Gallery page link, and I'll switch over in the Code view. That's a real quick and easy way to find your way around in your Source code so that you don't have to do a lot of scrolling. Okay, well if I am looking at line 76, here is the link tags. So I am just going to go ahead and highlight that so that you guys can see this. And we see we have the Well, one of the things that we did when we were building our database. And I am going to click back to the Bindings panel so that we can see this is-- we have see this element in our recordset called shortName, and shortName contains the first name of the artist and we did some prior planning and all of our links to our banner images, and to our bios page, and to our gallery page, they just use that first name. So I can actually just highlight the name in the link. Now, notice that I am not highlighting the whole link. I am just highlighting just the name.

I can actually go and grab the shortName from the recordset, and I can drag-and-drop that on the page. And it's going to go ahead and insert some server-side code here. Now this may seem kind of foreign to you, so let's take just a moment to examine the statement that was placed on the page. So we have a PHP tag and notice that we have the question mark at the beginning of the tag and at the end of the tag, and that indicates PHP content. Then we have echo, an echo in PHP is just telling the server to write something on the page. So we have our recordset, rsArtists, and notice that it's pulling from the recordset, shortName.

Now we're actually going to go ahead and do the same thing for the gallery. So on the same line, I am going to go ahead and highlight the name aimee there as well. I am going to go back and grab shortName again, and I will just drag-and-drop right over the highlighted text, and there is my PHP code. Now, you should always sort of double- check to make sure that replace just the code that you had highlighted. You want to make sure that no extra space is replaced in there, or a Period or a Quotation Mark is not out of place because it is that's going to cause some serious problem. So I will save this again, and we will test this in our browser one more time, and I am going to go ahead and update that on the server as well.

Again I am going to choose No on to put dependent file, unless those really change there is no reason for me to do that. Okay, we are seeing our repeating list of artists again and let's say I click on Chris' Gallery, and right here we have Chris' Gallery. I hit the Back button and scroll down a little bit further and I click on Greg's Bio and I get Greg's Bio. So now you can see all of our links are working, and they are doing exactly what we expected them to do. And we are doing that to the use of dynamic text.

So again dynamic development is saving us a lot of time. So we can see how easy it is that. Once you have your database set up, putting this information on the page and making it display the way you want to is fairly simple. In our next exercise, we are going to explore the concept of filtering data. Only showing data when certain criteria are met and we'll also explore the concept of passing information from one page to another.

Find answers to the most frequently asked questions about Dreamweaver CS3 Beyond the Basics.


Expand all | Collapse all
please wait ...
Q: In the Chapter 3 movie “Creating rounded corners with background graphics”, the instructor uses a .last class selector. What are the CSS properties of this selector?
A: The .last selector is as follows:
#current p.last{
background: url(../_images/current_btm_bg.gif) no-repeat bottom
left;
padding-bottom: 2em;
margin: 0;
}
The background is the bottom rounded corner graphic, the bottom padding keeps the type away from the bottom of the box and thus the rounded corners, and the margin ensures that the box elements fit seamlessly with each other.
 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

join now Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Dreamweaver CS3 Beyond the Basics.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

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.

Are you sure you want to delete this note?

No

Notes cannot be added for locked videos.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.