close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Detailed info on creating dynamic menus

Thread began 1/10/2011 9:40 am by webdesignfreebies311292 | Last modified 1/10/2011 1:46 pm by Jason Byrnes | 1228 views | 1 replies |

webdesignfreebies311292

Detailed info on creating dynamic menus

I need more detailed info on Creating Dynamic Menus. Your tutorials do not do a very good job of explaining this to the novice user. This is my MySql database:

CREATE TABLE IF NOT EXISTS `main_menu` (
`id_menu` int(11) NOT NULL AUTO_INCREMENT,
`parentID_menu` int(11) NOT NULL,
`label_menu` varchar(100) NOT NULL,
`link_menu` varchar(100) NOT NULL,
`target_menu` varchar(10) NOT NULL,
`highlight_menu` varchar(10) NOT NULL,
PRIMARY KEY (`id_menu`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;


INSERT INTO `main_menu` (`id_menu`, `parentID_menu`, `label_menu`, `link_menu`,
`target_menu`, `highlight_menu`) VALUES
(1, 0, 'Home', '#', '_self', '1'),
(2, 0, 'Accessories', '#', '_self', '2'),
(3, 0, 'Products', '#', '_self', '3'),
(4, 0, 'Contact', '#', '_self', '4'),
(5, 2, 'Accessory1', '#', '_self', ''),
(6, 3, 'Product1', '#', '_self', ''),
(7, 3, 'Product2', '#', '_self', '');

I'm not sure how to set the sort and filter to get the results I need. I need to know how to sort and filter the top level of the menu as well as the second level and the third once it's been added to the database.

Any help you can give me with this issue would be greatly appreciated.

Sign in to reply to this post

Jason ByrnesWebAssist

This table design will not work with the CSS Menu Writer Dynamic Menus.

For the Dynamic menus to work, the top level will need to be static, the sub menus can be dynamic though.

For example, take the menu in the screen shoot of the dynamic menus tutorial.
mw2_creating_dynamic_menus_ht.pdf

this menu is using two tables:

CREATE TABLE `items` (
`ItemID` int(10) NOT NULL AUTO_INCREMENT,
`ItemCatID` int(10) DEFAULT NULL,
`ItemName` varchar(255) DEFAULT NULL,
`ItemShortDesc` varchar(100) DEFAULT NULL,
`ItemLongDesc` longtext,
`ItemPrice` decimal(19,2) DEFAULT NULL,
`ItemSKU` varchar(255) DEFAULT NULL,
`ItemThumb` varchar(255) DEFAULT NULL,
`ItemImage` varchar(255) DEFAULT NULL,
`ItemWeight` double(7,2) DEFAULT NULL,
PRIMARY KEY (`ItemID`),
KEY `ItemsItemCatID` (`ItemCatID`),
KEY `ProductID` (`ItemID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=31 ;

--
-- Dumping data for table `items`
--

INSERT INTO `items` VALUES(1, 1, 'Body Double', 'The latest from Jenna Darleen', 'Get the latest tunes from this hot new star whose work truly rocks the house with her classic L.A.style and penetrating lyrics.', 19.99, 'BSM_001', 'cd1.jpg', 'cd1.jpg', 0.50);
INSERT INTO `items` VALUES(2, 1, 'So Last Season', 'Greatest hits of the past 6 months', 'Replay the best tunes from just six months ago with this classic collection of number one hits from the oh-so-recent past.', 19.99, 'BSM_002', 'cd2.jpg', 'cd2.jpg', 0.50);
INSERT INTO `items` VALUES(3, 1, 'HotFlash', 'Super songs from 8 track days', 'Even if don''t have a clue what an 8 track player looks like, you''ll remember these songs: they''re burned into your psyche!', 19.99, 'BSM_003', 'cd3.jpg', 'cd3.jpg', 0.50);
INSERT INTO `items` VALUES(4, 1, 'A-Go-Go', 'Dancing music - pure and simple', 'Break out the boots and get pumping - these tunes are meant to get you moving - and they''ll be no stopping them this time!', 19.99, 'BSM_004', 'cd4.jpg', 'cd4.jpg', 0.50);
INSERT INTO `items` VALUES(5, 1, 'Filtered Light', 'New world music from Jazzy G', 'Make way for Jazzy G''s slamming new set of love smashes and top spinning aces that serves it up with a phat baseline beat.', 24.99, 'BDM_005', 'cd5.jpg', 'cd5.jpg', 0.50);
INSERT INTO `items` VALUES(6, 1, 'DV8: Tendencies', 'Metal rap like you never heard it', 'Nu music for rapcore fans to rock all the kids in your crazy town as they rage against the machine and run da mc to the ground.', 19.99, 'BDM_006', 'cd6.jpg', 'cd6.jpg', 0.50);
INSERT INTO `items` VALUES(7, 2, 'Travel Mug', 'Java on the go, in style', 'Sleek stainless steel in a high polish colbalt steel travel mugs complete with no-drip lids, certified to keep your hots, hot and your colds, cold.', 9.99, 'BDM_007', 'gr1.jpg', 'gr1.jpg', 1.50);
INSERT INTO `items` VALUES(8, 2, 'Travel Tote', 'Carry your goodies with flair', 'Comfortable, secure, stylish and versative: that''s our tote! Includes a pocket for a phone, passport, keys and zippered pocket in the front for money or small wallet.', 9.99, 'BDM_008', 'gr2.jpg', 'gr2.jpg', 1.00);
INSERT INTO `items` VALUES(9, 2, 'Ball Cap', 'Noggin wear, like no other', ' Be comfortable when you walk around town or down the trail in your Blue Sky Music ball cap. This nifty ball cap keeps perspiration away from your head to help keep you dry and cool.', 9.99, 'BDM_009', 'gr3.jpg', 'gr3.jpg', 1.00);
INSERT INTO `items` VALUES(10, 2, 'Sport Backpack', 'Fashionable and practical carryall', 'Our day pack is designed for virtually any outdoor activity and loaded with features at an exceptional price. Keep on keeping on with multiple pockets inside and out, back and front.', 29.99, 'BDM_010', 'gr4.jpg', 'gr4.jpg', 4.00);
INSERT INTO `items` VALUES(11, 2, 'Knit Cap', 'One cozy head, coming up', 'Keep your head warm this winter with our stylish, unisex, winter beanie. This beanie comes in a universally stylish color ready to match your any outfit. Perfect for skiers and snowboarders!!', 19.99, 'BDM_011', 'gr5.jpg', 'gr5.jpg', 3.00);



CREATE TABLE `itemcategory` (
`ItemCatID` int(10) NOT NULL AUTO_INCREMENT,
`ItemCatName` varchar(50) DEFAULT NULL,
PRIMARY KEY (`ItemCatID`),
KEY `CategoryID` (`ItemCatID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `itemcategory`
--

INSERT INTO `itemcategory` VALUES(1, 'CD');
INSERT INTO `itemcategory` VALUES(2, 'Gear');




the main level menu will look like:
About Us
Products
Products Search


Now select Products and add a dynamic menu, this one will use the itemcategory table. Set the Label as itemCatName, set the key Column to itemCatID

Now, you will create the nested menu.

add a new dynamic submenu under the one you just created, this will use the items table. Set the label to sue the Item Name, set the ID to use the itemCatID column. In the filtering section, select the nested option.

see the screen shoots attached for more details.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

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.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...