Which would be the best to use?

liunx

Guest
I have a menu that will be dynamically created and can be small to large and contain sub menus, all depends on the customer's request. The content will depend on the specific customer and their login.

What is the best way to handle the menu system so that I don't have to go to the DB to regenerate it everytime they move to another page?

I thought about a session but that sounds ugly to me as the menu can be quite large. I then thought about caching it some how but am unsure what would be the most efficient way to go. This is being made in 2.0.

thanks :DHave multiple JS modules that are based on a particular user group i.e. regular users, moderators, super moderators. All users will have the user module. All moderators will have the moderator module and the user module. And all super moderators will have all modules. You can then dynamically create any menu items that aren't part of those modules.

The JS files would then be cached onto the users browser, and only the dynamically created menu items will need to be Download ed each time.Unfortunately, there are not roles like that.

1 customer may only want 10 of the 20 things on the menu while another will want all and then another will want just 17. Each menu item is a specific medical category and not all customers want their users to see everything based upon their beliefs, purpose, etc.First, you have to know when a user first comes on the site. You can do this through a cookie. Check if the cookie exists, if not, place a cookie with a GUID.

When the GUID is first used, then a JS file will be created with that GUID. For example, a user comes in for the first time and a file called FDLFJSDJF8908043209.js created. FDLFJSDJF8908043209 is an example of the GUID the server assigns to that particular user.

Then based on your database entries, fill in that FDLFJSDJF8908043209.js file with the database menus, and then have the pages use the <link> tag to use that file.

The JS will only need to be created once and Download ed once for each user until the cookie expires/gets deleted.Prefer not to set a cookie as many companies which use this, use this from a kiosk and disable cookies. There must be a better route than using a .js file. Something .net related.Sessions are your best bet.ajax.... doable?
 
Back
Top