List Articles

In this tutorial topic you will build the page that displays in the administration area the list of articles, with action buttons. To quickly build the list you will use NeXTensio. The generated list has some useful features, like filters, links, and buttons for the various actions (add, edit, and delete). After creating the basic list, you will enhance it to allow actions based on user level and article status:

  1. The add new button will be visible for authors only.

  2. The delete option will be visible for the webmaster only.

  3. The edit button will be visible for both authors and editors, based on the article status - if the article is a draft, than the author will be able to edit; if it is in review, only the reviewer.

Create the basic article list

To create the basic NeXTensio list for articles, follow the next steps:

  1. Open the admin/list page in Dreamweaver.

  2. Go to the MX Kollection tab of the Insert bar and click on the Create NeXTensio List Wizard icon. The wizard is divided into four (4) steps with various options.

  3. In the first step of the wizard define general options - the table to list, the form page:


                    

  4. In the second step of the wizard define which table columns to display, and with what values. To change the properties for a list column, select it in the grid and use the controls below the grid to change its properties. Configure each column as follows:


                  

  5. In the third step define what form element to use for each column filter. All the columns that use a look-up table to get the value are automatically configured to use a drop-down menu as the filter element. The menu is dynamic, based on the table for each field. Check if all options are correct, and move on to the last step:


                  

  6. In the last step of the wizard you can define list specific options:


                          

  7. Click Finish to close the wizard and apply the changes.

The wizard adds HTML code for the list, as well as application logic - recordsets that retrieve various information and server behaviors. If you try to preview the list in a browser, after logging in with one of the accounts, you can see all the action buttons - add new, edit and delete:

 

Create a logout link on the list page

You must also allow users logout from the administration section. To do so, you will add a link that will reset the session variables and redirect the user to the main site page:

  1. Open the admin/list page in Dreamweaver if needed.

  2. Place the cursor on top of the page - before the generated list layout, and press Enter/Return to create a new paragraph. Then return to the first page line (press the up arrow).

  3. Go to the Server Behaviors tab > Plus (+) >MX Kollection > User Login and select the Logout User entry. Configure the user interface as shown below:


               

  4. A new link will be created in page. If you click on it after logging in, you will be redirected to the main page.

 

 

Next you will modify the list so that action buttons will be displayed only when needed: