Show All

Creating a list block

A list block displays multiple database records in series. Each record occupies a borderless table inside one cell of a single-column table, and each field occupies one row in the record’s table.

Namo Web Editor 8.database.output.2.1 Creating a list block

A simple list block in Preview mode

Namo Web Editor icon reveal Creating a list 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 List Block.
Namo Web Editor icon reveal Creating a list 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 list 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 list blockStep 3: Database Fields
  1. For each database field you want to include in the list 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 list 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. If you want to filter the database records according to some criteria, enter a filter condition in the Filter box.
  3. If you want the records to be sorted a particular way in the list block, enter a sort condition in the Sort by box.
  4. Click Next.
Namo Web Editor icon reveal Creating a list blockStep 5: Block Elements
  1. If you want to remove one or more unnecessary block elements, select each and click Remove. (However, do not remove the Page Link Set element unless you intend to display all the records on one page.)
  2. Click Next.
Namo Web Editor icon reveal Creating a list blockStep 6: List Settings
  1. In the Number of rows box, enter the number of records you want the list block to display on a page. (If the number of records exceeds this number, page links will be automatically inserted at the bottom of the list block so that users can see all records.)
  2. Click Finish.

When you finish the Database Wizard, the list 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.2.2 Creating a list block

Example of a list 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.

The bottom row of the outer table (the table that contains all the record tables) contains a placeholder for page links that will be dynamically generated by the Web server when the number of records to be displayed exceeds the number of rows you specified for the list block.

To preview the list bloc
k with generated content, switch to Preview mode.

You can format the list 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 list block