Guide to building menu from Access database...

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
kedaniels
Advanced
Advanced
Posts: 12
Joined: Thu Oct 18, 2007 11:01 pm

Guide to building menu from Access database...

Post by kedaniels »

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
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Guide to building menu from Access database...

Post by Ruth »

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
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Re: Guide to building menu from Access database...

Post by John »

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.
John
kedaniels
Advanced
Advanced
Posts: 12
Joined: Thu Oct 18, 2007 11:01 pm

Re: Guide to building menu from Access database...

Post by kedaniels »

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: Select all

	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	
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....
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Guide to building menu from Access database...

Post by Ruth »

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
Post Reply