Back To Start Of Archive
Taken From The Forum: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Wednesday July 18 2012 - 06:07:36
Hide menu based on user level
Poster: ctreeves __at__ attbi.com
Dated: Saturday June 8 2002 - 2:00:59 BST
I have a site that is almost entirely cold fusion. I know nothing about javascript so I am very greatful for this project!
Our site is a hospital Intranet. Each user must log on to visist any page. At that time many session variables are set, one of which is their security level. I then use this level to set access to different pages, and display (or hide) links based on their level.
I have a few questions. Can I build a menu in a in a different page and then include it the page I am working on? I.E., let's say I make the manu in page Menu1.cfm and there isn't anything else on the page except for the menu. Can I then use a cold fusion function of CFINCLUDE to insert the menu item? I know this isn't a CF forum, but it is very similar to ASP and I know a lot of you guys have ASP experience.
This might also solve a different problem. If I do this I would likely use the CFINCLUDE inside of a table cell, would that allow for the menu to be truly positioned inside a cell?
If this is not possible, is there a similar way to have javascript set the access to the menu?
If these aren't possible, I can find other work arounds, but these would be cleaner.
Thanks in advance for the help.
Poster: SoTTo
Dated: Thursday June 13 2002 - 4:29:35 BST
I don't know anything about cf but,
yes (in ASP) you can set different menu's based on different users
(i let me asp write the menu_array to the page --> so you could check for the uservariable and then write this or that other menu)
Poster: theking __at__ mysecretbase.com
Dated: Thursday June 13 2002 - 7:45:08 BST
I've got a three solutions in ColdFusion that work with Milonic menus.
The first, ContentMonger Pro, is a Coldfusion-based content management system that does exactly what you describe: displays different menus depending on user access level.
CMPro uses as its backbone a customized version of a free custom tag called MenuMongerToo, which prebuilds the menu on the admin side, rather than allowing it to be built on the fly per page visit. If your menu is any sort of decent size, doing it this way turns a 650-750 ms load with a boatload of recursive loops and queries into a 40-60 ms page with a single cached query. Very slick.
Using MMToo and the idea behind it, you could build a menu system that is completely personalized to each user's group and tiered access permissions, and maybe store the users menu in an ntext field in their user record.
The third solution, MenuMonger Pro, uses the same pre-building that MMToo does. However its a complete, code-free idiot-proof Milonic menu builder. Missing only frame support and scrolling menus, I believe.
Thanks to Andy Woolley's generosity you can buy MMPro for US$35 and get a $30 commercial Milonic license included in the sale. MMPro is almost certainly going to be incorporated into CMPro in the near future.
You can find 'em all at the Macromedia Developers Exchange, or go to
http://foohbar.org
Cheers,
Poster: ctreeves __at__ attbi.com
Dated: Thursday June 13 2002 - 11:20:11 BST
Hey Matt,
Thanks for the reply. I had e-mailed you from your site and you recently responded.
I'm still not too sure which way to go.
Using one of your products, will I be able to edit the menu once created?
I want to be able to generate menus, have parts "hidden" from non-approved users and be able to simply edit and update the menu at a later time.
Again, as you are aware, I want to use the tools of CF to do some of this while using the Milonic menu. Of those that I've seen I like this the best and am currently using an older version on our Intranet. I plan to do a lot of site updates and want to clean up the menu part as well. It is poorly designed now and I'm looking for a more professional look. THis will be a daunting task for someone with no coding experience or schooling.
Thanks for the reply. And please outline which of your products you recommend and why.
Poster: theking __at__ mysecretbase.com
Dated: Thursday June 13 2002 - 18:43:54 BST
OK, I remember now.
Your situation is a tough one. You want to have individual menu choices available, but you're not too experienced in CF coding. There's the rub.
The thing is, as I see it, you are absolutely going to have to roll your sleeves up and code a custom solution, given your desires. MMToo gives you exactly what you need to do that, in that once you provide the security and permission information for each user, you can use MMToo to build and store that person's menu system.
However, thats not going to be an out-of-the-box solution coming from *anyone*. CMPro is the closest you'll find to something like that. I examined the per-user menu idea and discarded it because the system load would be astronomical as the user count climbs. My menu pre-building process is a great resource saver, but not if you have to run the thing for, say, 200 users after a series of updates.
If you say ''fine, I'll switch to real-time menu building, so I can make display decisions in real time'' then server load will get you as your page count climbs. Before I switched to pre-building, I created a real-time routine that worked, but execution grew to 650-750ms (thats a LOT) in short order, and only increases as your menu gets bigger. I think I was in the 50-75 page range at that speed.
I would use the free MMToo tool as the basis for your project. However, your desire to hide certain sections of your menu may not be feasible, depending on how flexible you want it to be. Limits via tiered access and whether a page is approved for publication?: No sweat, and you don't need to build per-user. CMPro does that now.
Add into that selective display based on group and approved permissions? Forget it unless you are very, very committed to the project, know CF really well and are willing to take the performance hit. I settled on a ''you don't have permission'' dialog box to solve group permission issues within a given access tier's display.