When you want to show multiple categories on a web page AND show the items within that category, you need to nest recordsets. If that's not second nature to you because... oh, I don't know... you like to see the light of day, follow this tutorial to master the technique.
Insert > menu_category.php
- Click on the pages under the Define Features section
- Change the names under the Page Name & Location field
Insert > menu_items.php
- Click on the pages under the Define Features section
- Change the names under the Page Name & Location field
And look at that... your page is made. Miracles DO happen. Go add some stuff to your database using the pages we just created. Populate!
Now we need to add some bindings to the page that will show the data we want from the database.
This will show the CategoryName in an <h1> formatting so it's nice and bold
This will show ItemName in a little less bold, but still nice and bold look
<p style="float:right">
And this shows the ItemPrice in a <p> tag that's aligned to the right so it really stands out.
Next up we're going to make those bindings loop until they get dizzy.
In Code view again, we're going to add closing and opening php tags to separate the two recordsets we created, then move the MenuItems recordset into the first Repeat Selection Server Behavior so we can use it to show the correct item information.
?>
<?php
<?php$_GET['ItemCategory'] = $row_MenuCat['CategoryID'];
?>
Now you only need to take this knowledge you just gained, and add it to your own site. Make it beautiful, then tell us about it because we'll totally hang a picture of it on our refrigerator out of pride.
Comments will be sent to the author of this tutorial and may not be answered immediately. For general help from WebAssist, please visit technical support.
Sign in to add commentsYour friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.
MarkNewsom: 10 Years, 7 Months, 2 Days, 18 Hours, 42 Minutes ago
Where's the download link for the preset you mention in this tutorial? I've spent 20 minutes trying to find it on your site.
Team WebAssist: 10 Years, 7 Months, 2 Days, 17 Hours, 37 Minutes ago
It's the zip in the What you Need to Start section above.
Dave W: 10 Years, 7 Months, 2 Days, 12 Hours, 13 Minutes ago
The zip code is not being accepted by the preset manager, it's stating that it is not a valid databridge application code
Team WebAssist: 10 Years, 6 Months, 4 Weeks, 2 Days, 22 Hours, 41 Minutes ago
We are testing and will post a new zip file ASAP! So sorry for the inconvenience.
Surdej Web Solutions: 10 Years, 6 Months, 4 Weeks, 2 Days, 41 Minutes ago
Having the same problem with the Zip file... Not A Valid Data Bridge Application Preset. Please let us know when the new ZIP is available.
Justin Hood: 10 Years, 6 Months, 4 Weeks, 1 Day, 18 Hours, 41 Minutes ago
The Presets have been fixed for OSX users. They should now properly import into the Preset Manager.
Dave W: 10 Years, 6 Months, 4 Weeks, 1 Day, 14 Hours, 36 Minutes ago
Still not fixed for Windows then?
Team WebAssist: 10 Years, 6 Months, 4 Weeks, 20 Hours, 30 Minutes ago
We couldn't reproduce the problem in Windows. Are you on Windows? If so, can you give version details on your OS and Dreamweaver.
Dave W: 10 Years, 6 Months, 4 Weeks, 12 Hours, 36 Minutes ago
Yes, I'm using Windows 8.1 and Dreamweaver CS6
Dave W: 10 Years, 6 Months, 4 Weeks, 12 Hours, 31 Minutes ago
I have also tried deleting the WinFile and restating Dreamweaver but still it will not accept it.
Team WebAssist: 10 Years, 6 Months, 3 Weeks, 6 Days, 21 Hours, 22 Minutes ago
Passed this on to the testing team to figure out the issue on your platform and get it resolved. You are always welcome to comment on a tutorial and let us know if something isn't working, but in general, you will get much quicker assistance if you go straight to Tech Support. (Click help in the main menu.) We *will* get this resolved; just wanted to give that general advice. :)
Justin Hood: 10 Years, 6 Months, 3 Weeks, 6 Days, 19 Hours, 9 Minutes ago
Dave,
There shouldn't be any issues preventing the installation of this preset into Data Bridge under any OS anymore.
The .zip file provided actually contains two additional .zip files that are the presets themselves.
Are you extracting menu_items.zip and menu_categories.zip from data-bridge-nested-recordset-display.zip and then attempting to import them? You should be selecting either menu_items.zip or menu_categories.zip when using Import in the Preset Manager.
If you are following those steps and still having an issue, please reply with the version of Data Bridge you have installed as well as any other extensions also installed.
Dave W: 10 Years, 6 Months, 3 Weeks, 6 Days, 13 Hours, 51 Minutes ago
Hi Justin,
Thanks for your reply. I have done what you suggest and both the menu items and menu categories imported OK. I will now go through the tutorial and see if it all works OK. Perhaps it would be wise to inform users that it may be necessary to extract the zips before installing them as with previous zip presets it was not necessary to do this.
Thanks again for your help.
: 3 Years, 2 Months, 2 Weeks, 1 Day, 21 Hours, 31 Minutes ago
I've got everything working, until step 3.7. Here's what I have in the code:
<?php
$_GET['ItemCategory'] = $row_MenuCat['CategoryID'];
?>
and in the web page, the categories show up, but the items do not. Here's what's in the php_error.log
[05-Sep-2021 12:17:23 America/Detroit] PHP Notice: Undefined variable: row_MenuCat in /Users/dan/website/menu.php on line 28
[05-Sep-2021 12:17:23 America/Detroit] PHP Stack trace:
[05-Sep-2021 12:17:23 America/Detroit] PHP 1. {main}() /Users/dan/website/menu.php:0
Any suggestions on what's wrong? It seems like the row_MenuCat is having issues...