Forums Archive Index > SmartMenus 5 > Dynamic menu creation based on login?

Author: abarsami

Date: 7 Dec 2004 5:43 am

Is this possible with these menus? Since you have to include the s_loader.js in every bottom frame page.

Can these framed menus work without including s_loader.js in every bottom page? Just include it in the 1 frame top page.

Based on the cookie value of whoever logs in they would see maybe 1 or 2 more menu items than other people.

This would prob. require a bunch of different s_arrays.js pages and the right one would be loaded from s_loader.js.

Is the dynamic menu creation possible or am I reaching for straws?


Author: smartmenus

Date: 9 Dec 2004 11:01 am

abarsami wrote:
Can these framed menus work without including s_loader.js in every bottom page? Just include it in the 1 frame top page.Nope, this is not possible. A link to the "s_loader.js" file must be present in all pages that will be loaded in the frame where the menus should pop.

Otherwise, it's not a problem to load different setup of menus based on login. I think in your case the easiest way would be to create 2 different definition files (let's say "s_arrays_not_logged.js" and "s_arrays_logged.js"). Then you can place the code that reads the cookie at the beginning of your "s_loader.js" file and set different value to the "s_The_Arrays_Source" variable according to the value you keep in the cookie.