Add artist names as items in the Menu panel

In the AJAX Panels tab of the Files panel, click the Menu (default state) item in order to make it editable in the index master page. First of all, you need to create a recordset to use for retrieving the required information (artist names). Go to the Application panel, Bindings -> + -> Recordset (Query). Configure the window that opens as shown below:

 

  1. Name the recordset rsArtistNames.

  2. Select the conn_music_catalog database connection defined earlier.

  3. Select the artist_art database table to retrieve information for completing the menu.

  4. Select only two of the table columns, namely id_art (used when transforming each menu entry into a link) and name_art (it will be displayed in the menu).

  5. Do not filter the recordset.

  6. Sort the records ascending by the name_art column so that they will be displayed in alphabetical order.

  7. You can press the Test button and see the retrieved data (artist names).

  8. Click OK to create the recordset.

 

Add the artist names to the menu by following the instructions below:

  1. In the index file, in the Menu panel, place the cursor after the Home item and press Enter. In the new bulleted list item enter the following text: Favorite artists.

  2. Create another list item (press Enter) below the Favorite artists one, and then press the Text Indent button in the Property Inspector.

  3. Expand the rsArtistNames recordset in the Bindings tab of the Application panel, and drag and drop the name_art column in the new empty list item.

    Note:
    You will notice that in Design view, the Content panel went underneath the Menu one. This happened because the dynamic text dropped in page is pretty wide, and it expands the width of the Menu panel, causing the two panels not to fit next to each other anymore (the width of the wrapper container is 800 pixels - check out the \includes\jaxon\css\panels.css file):


                               
    That page in browser looks OK though, so do not worry about this.

  4. Click the dynamic text dropped in page, and then the last <li> tag in the Tag Selector (it is already highlighted, but it is important to click it again) to select the list element in the nested bulleted list.

  5. Keep the current selection and click the Repeated Region icon in the Application tab of the Insert bar. Configure the window that opens as shown below:


          

  6. If you save, upload, and preview the index page in browser, you will notice that the menu items are indented a little too much and the longer artist names spread on two rows. To fix this issue in the Menu panel, switch to Code view in Dreamweaver, and locate the opening <ul> tags for the two bulleted lists. Right before ">" add  style="margin-left: 20px; padding: 0px;". The two code lines should become:

Save the index file and upload it to the server. Preview it in browser (press F12) to see the new menu:

 

Continue to work on the site menu and transform the artist names into AJAX links with tooltips:

  1. If you want a rich-text tooltip to be displayed when the mouse pointer hovers these menu items, you need to decide upon a panel state from where the tooltip to be retrieved: it can be the same state to which the menu item points or another one, especially created for the tooltip. Go with the second possibility.

  2. Click the Add State icon in the MX AJAX Toolbox tab of the Insert bar. Configure the window that opens as shown below:


                              

  3. Once the state is created, you are automatically redirected to it and you can edit it. So since you are there, edit the MenuTooltip state right now.

  4. First of all, you need to create a recordset to use for retrieving information about each artist (picture and short description). Go to the Application panel, Bindings -> + -> Recordset (Query). Configure the window that opens as shown below:


                             

  5. Remove the default content (press Ctrl+A and then Delete) from the MenuTooltip state.

  6. Click the Images : Image icon in the Common tab of the Insert bar and configure the dialog box that opens as shown below:


                            

  7. Click Cancel in the Image Tag Accessibility Attributes dialog box that pops-up, as explained here.

  8. Create a new paragraph below the dynamic image inserted in page (in Design view, press the right arrow key to deselect it and then Enter). Expand the rsArtistTooltip recordset in the Bindings tab of the Application panel, and drag and drop the desc_art column in the new paragraph. With this, the tooltip panel state is complete. Save the changes.

  9. To go back and complete the default state of the Menu panel, click the Edit Panel States button in the MX AJAX Toolbox tab of the Insert bar. In the pop-up menu that shows, select the Menu - default item in order to make it editable in the index master page:


                           

  10. Click the {rsArtistNames.name_art} dynamic text in the default state of the Menu panel. Apply the AJAX Link server behavior from the Application panel, Server Behaviors -> + -> MX AJAX Toolbox. The dialog box has three tabs.

    Note:
    You can also apply the AJAX Link command from the MX AJAX Toolbox tab of the Insert bar.
                                         

  11. Configure the first tab (Basic) of the AJAX Link server behavior as shown below:


                          

  12. Configure the second tab (Parameters) of the AJAX Link server behavior as shown below:


                         

  13. Configure the third tab (Tooltips) of the AJAX Link server behavior as shown below:


                      

The Menu panel (with its only default state) is now completed. Save the index file and upload it to the server. Preview it in browser (press F12) and check out the menu on the left:

 

Notice how the artist names are displayed as links and how a tooltip window (200x400) shows whenever the mouse hovers one of the items.

In the next topic you will create the page that displays information about artists.