Basic XML / Finish and Display the Menu
Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.
Learn More
Subtitles of the Movie
In our example, the config menu XML file has an area called admin with lists for each section and then items for each list. We've created a variable by parsing this XML document with Cold Fusions XML parse function. And we've displayed the first level we need from the array that was created. Now, we'll display the next level and then use this file to create the menu in the "Where's Tom" application admin area. For the next level, we'll loop through the children of each list and output each set of display text and link information. In this array length function we're specifying this particular list and its children. Again specifying this particular list, this item from this list and its display text, referenced by XML text. Then we are outputting the link. Again this particular list, this item, the link and XML text. Because the display text and link information is not stored in attributes, but instead is character data inside a set of tags, It is referenced using the XML text member of the menu array. If we browse to this document, then we can see the activities list and both items underneath it, the locations list and the items underneath it, and the users list and the items underneath it. Now that we have the display referencing the correct elements, we can just change the style so the menu displays as it should in the main page. We'll add a href tag, and put in the value of the link text. The href tag will wrap around the display text. Then we want to put in the pipes that separate the menus but only if this isn't the last of this list. Now in the main menu file, we can comment out the hard coded menu and include this file to create the menu. Now we can log in to our admin area to see our menu. If we wanted to add an item or a list to this menu, all we would need to do is add elements to our configuration file. Let's add another element to the activities area in our config XML document. We can just copy the item, paste it. We can call it "Find Tom". The step is results and the user is hunt. Now if we refresh this page, we can see that our menu item has been added. 0:04:52.0] Now if we refresh this page, we can see that our menu item has been added.
Tutorial Information
| Course: | Macromedia ColdFusion MX |
| Author: | Darcey Spears |
| SKU: | 33474 |
| ISBN: | 1932072772 |
| Release Date: | 2004-03-05 |
| Duration: | 6.5 hrs / 102 lessons |
| Work Files: |
Yes |
| Captions: | For Online University members only |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 