Show All

Creating a detail block

A detail block displays a single database record. Each database field occupies one row in a table.

Namo Web Editor 8.database.output.3.1 Creating a detail block

A simple detail block in Preview mode

Namo Web Editor icon reveal Creating a detail blockStarting the Database Wizard
  1. Place the insertion point anywhere in the current document.
  2. On the Develop menu, go to Database, click Block, and then click Detail Block.
Namo Web Editor icon reveal Creating a detail blockStep 1: Document Type
  1. Click the Script type box and select the dynamic document standard you want to use.
  2. Click the Database box and select the appropriate connection method for your database. (If you chose ASP as the script type, you will only be able to select ODBC.)
  3. Click Next.
Namo Web Editor icon reveal Creating a detail blockStep 2: Data Source
  1. Do one of the following, depending on your selection in the Database box in Step 1 of the wizard:
    • If you chose ODBC: Click the Data source box and select the ODBC data source corresponding to your database.
    • If you chose MySQL:
      1. In the MySQL host box, enter the hostname or IP address and port number of your MySQL server, replacing the text within brackets. Also delete the brackets.
      2. In the MySQL DB name box, enter the name of your MySQL database.
    • If you chose one of the JDBC connection methods (for a JSP document): In the Data source URL box, replace the parameters in brackets with appropriate values for your database. Also delete the brackets.
  2. If your data source or database is password-protected, fill in the User ID and Password boxes.
  3. If you chose a connection method other than ODBC in Step 1 of the wizard, click the ODBC DSN for preview box and select the ODBC data source corresponding to your database.
  4. Click Next.
Namo Web Editor icon reveal Creating a detail blockStep 3: Database Fields
  1. For each database field you want to include in the detail block, select the field in the box on the left and click Add. To add all the fields in a table, select the table and click Add.
  2. Click Next.
Namo Web Editor icon reveal Creating a detail blockStep 4: Selection Statement
  1. If you added fields from more than one table in Step 3 of the wizard, enter a join condition in the Join box.
  2. In the Filter box, enter a filter condition to select the record to be displayed in the detail block. (For information about configuring a detail block to display a specific record depending on the value of a parameter in the URL, see “Using parameters with database-driven documents“.)
  3. Click Next.
Namo Web Editor icon reveal Creating a detail blockStep 5: Block Elements
  1. If you want to remove one or more unnecessary block elements, select each and click Remove.
  2. Click Finish.

When you finish the Database Wizard, the detail block will be inserted into the current document. In Edit mode, the block will initially look something like the following:

Namo Web Editor 8.database.output.3.2 Creating a detail block

Example of a detail block in Edit mode before modification

The highlighted words “[val]” in the right column represent output elementsIn a database-driven content block, an element that displays the contents of a single database field.. These placeholders will be replaced with generated content—actual data from the database—when the document is opened in a browser. Do not delete a placeholder, unless you want to remove the corresponding block element.

The default element labels in the left column are simply the names of the database fields you selected in Step 3 of the wizard. Since these headers are static, plain text, you can replace them with any content you want.

To preview the detail block with generated content, switch to Preview mode.

You can format the detail block as you would an ordinary table. You can also format the text inside it and add static content, such as images. For more information about formatting a block, see “Formatting database-driven content“.

Related topics

Joining fields from two or more database tables

Working with block elements

Formatting database-driven content

Creating a detail block