View comments | RSS feed

Making HTML attributes dynamic

You can dynamically change the appearance of a page by binding HTML attributes to data. For example, you can change the background image of a table by binding the table's background attribute to a field in a recordset.

You can bind HTML attributes with the Bindings panel or with the Property inspector.

To make HTML attributes dynamic with the Bindings panel:

  1. Open the Bindings panel by choosing Window > Bindings.
  2. Make sure the Bindings panel lists the data source you want to use.

    The content source should contain data that's appropriate for the HTML attribute you want to bind. If no sources of content appear in the list, or if the available content sources don't meet your needs, click the Plus (+) button to define a new data source. For instructions, see Defining Sources of Dynamic Content.

  3. In Design view, select an HTML object.

    For example, to select an HTML table, click inside the table and click the <table> tag in the the tag selector on the bottom-left of the Document window.

  4. In the Bindings panel, select a content source from your list.
  5. In the Bind To box, select an HTML attribute from the pop-up menu.
  6. Click Bind.

The next time the page runs on the application server, the value of the data source will be assigned to the HTML attribute.

To make HTML attributes dynamic with the Property inspector:

  1. In Design view, select an HTML object and open the Property inspector (Window > Properties).

    For example, to select an HTML table, click inside the table and click the <table> tag in the tag selector on the bottom-left of the Document window.

  2. How you bind a dynamic content source to the HTML attribute depends on where it is located:
  3. To make the attribute's value dynamic, click the attribute; then click the lightning-bolt icon or folder icon at the end of the attribute's row.

    If you clicked the lightning bolt icon, a list of data sources appears.

    Here's an example:



    If you clicked the folder icon, a file selection dialog box appears. Select the Data Sources option to display a list of content sources.

  4. Select a source of content from the list of content sources.

    The content source should hold data that's appropriate for the HTML attribute you want to bind. If no content sources appear in the list, or if the available content sources don't meet your needs, define a new content source. For instructions, see Obtaining Data for Your Page.

  5. Click OK.

The next time the page runs on the application server, the value of the data source will be assigned to the HTML attribute.


Comments


Jon9999 said on Jul 4, 2006 at 9:59 PM :
In Step 2 of the section "To make HTML attributes dynamic with the Property Inspector" section of this help page, it says:

"If the attribute you want to bind does not have a folder icon next to it, click the List tab (the lower of the two tabs) on the left side of the inspector. The Property inspector’s List view appears."

I can't seem to find any sort of List tab -- or any tab, for that matter -- on the left side of the Property Inspector. Is this Help topic wrong?

(I thought initially that maybe it meant to say Tag Inspector instead of Property Inspector, but the Help topic then goes on to mention the List view's "(+) button"; there's no such button in the Tag Inspector's List view, so that's not it either.)
jonmichael said on Jul 11, 2006 at 4:45 PM :
You're correct, this documentation is out of date. The properties referred to in this topic were relocated to the Tag Inspector a few versions ago. You can find the "List view" of HTML attributes by opening the Tag Inspector (Window > Tag Inspector) and clicking the Attributes tab. Select items in the list to see whether or not they have folders or dynamic icons next to them.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/dreamweaver/8/using/36_addi7.htm