Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:27
Guide to building menu from Access database...
Poster: kedaniels
Dated: Monday October 22 2007 - 19:42:21 BST
hi all, I'm new to Milonic menus. I'm building an ecommerce website for a client and she fell in love with a menu (from another site) that was build using milonic.
She has decided that "Tramline" has to be her menu. I've read the basics and I understand how to get a static menu up and running. I need to build my menu from an access databse. My menu can have multiple submenu levels. All the data (menu id, parent id, sort order, menu desc and html link are all stored in one dB table. Is there any guide / samples that would point me in the write direction for building my Milinoc menus this way.
Thanks,
Kim
Re: Guide to building menu from Access database...
Poster: Ruth
Dated: Tuesday October 23 2007 - 7:41:10 BST
Hi,
There is a folder called extras in the download, that folder contains things like php, php/mysql, asp menus and so on. Perhaps what you need is in that area. I am not knowledgeable about any kind of database menu. You might try searching the forum under database, ecommerce. I will post to Milonic, but you might contact them from the main site about the issue.
I know the menu works with database since we have so many who use them, but that is the limit of my knowledge. Sorry...
Ruth
Re: Guide to building menu from Access database...
Poster: John
Dated: Tuesday October 23 2007 - 17:27:23 BST
My guess is this would be the same as using any DB. Many folks here are using the PHP/MySQL combo (you didn't say what language you're using), and there are loads of posts in the forum with some good tips. Try the Search feature. Also see the php_mysql_based_menu item located in the extras folder in the menu download.
Let us know if you get stuck.
Re: Guide to building menu from Access database...
Poster: kedaniels
Dated: Wednesday October 24 2007 - 18:47:28 BST
I'm still not getting exactly how to build this. I've currently built a static menu (http://www.mspphq.com). It's inside a table and seems to be working fine. I created a embedded_main_menu.js (that has my main menu) and my menu_data.js has the styles and the "with" calls for all the submenus.
I have a function on my asp page that I used to build my menus (when they were just an html list).
Code:
mySQL = "SELECT idCategory, categoryDesc,categoryHTML," _
& " (SELECT COUNT(*) " _
& " FROM products, categories_products " _
& " WHERE products.idProduct = categories_products.idProduct " _
& " AND categories_products.idCategory = categories.idCategory " _
& " AND active = -1) " _
& " AS prodCount " _
& "FROM categories " _
& "WHERE idParentcategory = " & validSQL(idCategory,"I") & " " _
& "ORDER BY sortOrder, categoryDesc "
set rsTemp = openRSexecute(mySQL)
if not rsTemp.EOF then
catArr = rsTemp.getRows()
end if
call closeRS(rsTemp)
if isArray(catArr) then
tempStr = tempStr & "<UL style=""list-style-type=none; padding-left=0px"">"
for row = 0 to UBound(catArr,2)
tempStr = tempStr & "<LI style=""list-style-type=none; margin-left=0px; padding-left=0px"">"
tempStr = tempStr & catArr(2,row)
if catArr(3,row) = 0 then
tempStr = tempStr & "<span class=CPcatDesc>" & langCategory(catArr(0,row),"categoryDesc",catArr(1,row)) & "</span>"
else
'tempStr = tempStr & "<span class=CPcatDescProd><a href=""prodList.asp?idCategory=" & catArr(0,row) & """>" & langCategory(catArr(0,row),"categoryDesc",catArr(1,row)) & "</a> (" & catArr(3,row) & ")</span>"
tempStr = tempStr & "<span class=CPcatDescProd><a href=""prodList.asp?idCategory=" & catArr(0,row) & """>" & langCategory(catArr(0,row),"categoryDesc",catArr(1,row)) & "</a></span>"
end if
tempStr = tempStr & "</LI>" & vbCrLf
tempStr = ShowFeaturedCat2(catArr(0,row),tempStr)
next
tempStr = tempStr & "</UL>"
end if
& " (SELECT COUNT(*) " _
& " FROM products, categories_products " _
& " WHERE products.idProduct = categories_products.idProduct " _
& " AND categories_products.idCategory = categories.idCategory " _
& " AND active = -1) " _
& " AS prodCount " _
& "FROM categories " _
& "WHERE idParentcategory = " & validSQL(idCategory,"I") & " " _
& "ORDER BY sortOrder, categoryDesc "
set rsTemp = openRSexecute(mySQL)
if not rsTemp.EOF then
catArr = rsTemp.getRows()
end if
call closeRS(rsTemp)
if isArray(catArr) then
tempStr = tempStr & "<UL style=""list-style-type=none; padding-left=0px"">"
for row = 0 to UBound(catArr,2)
tempStr = tempStr & "<LI style=""list-style-type=none; margin-left=0px; padding-left=0px"">"
tempStr = tempStr & catArr(2,row)
if catArr(3,row) = 0 then
tempStr = tempStr & "<span class=CPcatDesc>" & langCategory(catArr(0,row),"categoryDesc",catArr(1,row)) & "</span>"
else
'tempStr = tempStr & "<span class=CPcatDescProd><a href=""prodList.asp?idCategory=" & catArr(0,row) & """>" & langCategory(catArr(0,row),"categoryDesc",catArr(1,row)) & "</a> (" & catArr(3,row) & ")</span>"
tempStr = tempStr & "<span class=CPcatDescProd><a href=""prodList.asp?idCategory=" & catArr(0,row) & """>" & langCategory(catArr(0,row),"categoryDesc",catArr(1,row)) & "</a></span>"
end if
tempStr = tempStr & "</LI>" & vbCrLf
tempStr = ShowFeaturedCat2(catArr(0,row),tempStr)
next
tempStr = tempStr & "</UL>"
end if
This worked great in building my menu in the list.
So I have my data in an array. Now how to do I go about taking this query and code using it to build my menus (I guess I'm confused because my menu data is in 2 different files; amoung other confusing things.) Each menu item can have a submenu (ad infinitum... we probably 10 deep at max).
Does anyone have any time to walk me thru some of this....
Re: Guide to building menu from Access database...
Poster: Ruth
Dated: Wednesday October 24 2007 - 20:59:27 BST
Hi,
I'm sorry that I can't help you. But, there is an asp menu in the download. And, I know that for things like cold fusion, php etc. the menu_data.js gets rename, i.e. menu_data.php, menu_data.cfm. I don't know if that's what you have to do to get the database stuff, menu_data.asp??? I will post to Milonic, you might also go to the main site and contact Milonic.
Ruth