In this 'how to' tutorial you will learn how to display in a drop-down menu the existing categories (also shown in the navigation bar A set of graphical or textual buttons containing hyperlinks to pages that are part of the same web structure. Sometimes shortened to "Navbar", it allows users to browse back and forth through a group of records, or allow to view items associated with a selected category or letter/character. built with MX Navigation Pack), and how to view all the items associated to the selected category at the click of one button.
This is very useful when you are working with many categories:
To display them all at the same time would be too much.
To display one at a time and browse through many of them until you reach the lucky one would take too long.
By using a drop-down menu, you can simply select the category you are interested in and then see all its associated items.
The database A database refers to data organized and stored on a computer that can be searched and retrieved by a computer program. Most industrial-strength and many smaller database applications can be addressed using SQL (Structured Query Language). structure used is clear and simple. It uses the following two tables:
Note: The database diagram in the image above was built with MX Query A query is a SQL command that will extract information from the tables of a database. Essentially, a query is a request for information from your database. Builder (an InterAKT product, also referred as QuB) to better illustrate the database structure. You do not need to build it in order to complete this 'how to' tutorial.
The continent_con table stores data about continents:
id_con - continent ID.
name_con - continent name.
The country_cnt table stores data about countries:
id_cnt - country ID.
name_cnt - country name.
capital_cnt - capital of the country.
idcon_cnt - ID of the continent where the country is placed.
There is a one-to-many relation between the two tables: one continent can have more countries, while a country belongs to one continent.
To quickly create the database structure, use the scripts provided in the .zip package (either .sql or .mdb) corresponding to your database server. You can find the scripts in the \tutorials\_HOW_TO\Categories menu\db\ folder.
Before you start building the actual application, there are a few things that you should do:
Make sure you have a correctly configured site in Dreamweaver.
In order to complete this tutorial, you only need one file in the Dreamweaver site. Create it and name it index To index a list is to arrange it in a certain order (alphabetically, most common), in order to easily find its elements..
Open the index page and define a Dreamweaver database connection: conn_categ_menu. Configure it to connect to your database server and make it point to the database containing the tables described above.
Note: For more instructions on how to configure your site and how to create the database connection, consult the Getting started help file. It can be accessed from the Help menu, InterAKT -> Getting Started.
The estimated completion time for this tutorial is about 20-30 minutes. It also depends on your authoring knowledge with Dreamweaver and MX Navigation Pack.
The only Dreamweaver extension you need in order to follow this tutorial is:
Add a navigation bar for continent categories
Display continent categories in a drop-down menu