473,499 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Menu from database ?

Hi group

I realy need help for this. I must say that i am pretty unskilled as
programmer, so please dont be to tough with me :-)

I am trying to make a menu for my cms.

I got a db that looks like this:

------------------------------------------------
uid id level menuitem
------------------------------------------------
0 873 0 Top level 1
873 874 1 sub 1 subpage
0 875 0 Top level 2
875 876 1 sub 2 subpage 1
875 877 1 sub 2 subpage 2
873 878 1 sub 1 subpage 2
0 879 0 Top level 3
879 880 1 sub 3 subpage 1
879 885 1 sub 3 subpage 2
879 886 1 sub 3 subpage 3
886 887 2 sub 4 subpage 1
886 888 2 sub 4 subpage 2
------------------------------------------------

What i want is a top menu and for each top menu item i want a left menu -
and for the left menu items i want subitems and so on.When users click menu
items they must be highlighted - also sub and subsub.
It is most important that users can save the url in "favorites" and that all
the menu steps are highlighted as they where when the user first chose the
page - when they enter the page from "favorites" og type in the url again
later.

That means that a page like "artikel.asp?id=888" should leave a highlighted
top menu (879) a left side sublevel (886) and a subsub level (888).

Can some of you please help me with a code snipet?

Best regards to group

KA
Jul 22 '05 #1
1 1180
Tim
Klaus Andersen wrote:
Can some of you please help me with a code snipet?

I hope you will get agood answer to this but I doubt it, the question is
to broad and contains to little details.

Your best bet is probably to write as much code as you can and ask for
directions when you get stuck. At that point, also include the code you
have written so far.

I planed to give you some advice to get you started here but then I
realized I am not even sure what you want to accomplish.
It is easy enough to find all the toplevels:

SELECT * FROM table WHERE level=0

But how then do you know what sublevel belongs to what top level? My
guess is that you want two cathegory columns instead of the level column
and item column.

uid id cat1 cat2
top1 item1
top1 item2
top2 item3

This table would mean that item1 and item 2 are two elements in the
first cathegory, item3 on the other hand is the only item in the top2
category.

I am not at al sure if this is what you meant or if I am way of but my
best advice is to write some code and try to get it to work and post
your best efforts here.

Tim

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5159
by: Steven | last post by:
I have some text boxes on a form in MS Access 2000. When I right click in them I don't get any shortcut menu at all. I want the normal cut, copy, and past menu to come up. In the "Startup", I...
3
1934
by: Jigar Mehta | last post by:
Hye, This is Jigar mehta from India. I have made one application that adds dynamic menu items from the database. Each menu item has one ID and menu item's text is coming from the database. Now, I...
6
470
by: brian | last post by:
I am looking at purchasing or creating a dynamic navigational menu system that would be binded to SQL server 2000 data. The users id is stored in the SQL server and based on the id is what the...
6
3210
by: Sandy | last post by:
Hello - I have a book that illustrates pulling menu items from a Sql Server table into an ascx via a stored procedure. Is this something that is done in the real world? I do like the effect...
4
19077
by: snowweb | last post by:
I am trying to implement a CSS hierarchical unfolding menu on a site. The thing is, it needs to be dynamically populated from the results of a database query. I previously had the menu working but...
3
2107
by: jayender.vs | last post by:
Hi, I am doing a menu in asp.net here is the sample code for that: <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" > <Items>
27
45483
by: Wayne | last post by:
I've been clicking around Access 2007 Beta 2 and can't see the custom menu bar designer. Is it in the beta? Maybe I'm blind. The question that comes to mind is: Will custom menu bars be the same...
0
929
by: SV | last post by:
I'm trying to create a menu who's first level is generated from a database stored procedure based on the user. The second and third levels are pulled from a table and are the same for all users. ...
6
2023
by: roguefeebo | last post by:
Hello everyone, thanks for looking. I'll get right to the point: I'm having problems trying to figure out a hierarchy of menus in C; command-line style. Say, for example the program analyzes a...
3
4596
by: jaddi1 | last post by:
Hi, I am trying to make a multi-level drop-down menu similar to what is seen here: http://www.cssplay.co.uk/menus/simple_vertical.html. My problem is that some of the menu will be populated from...
0
7132
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5475
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.