Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:43

Coldfusion and Milonic: <CFIF> Logged In & Admin,


Poster: mybiodiesel.org
Dated: Friday May 27 2005 - 18:21:52 BST

Okay, first... go to http://www.mybiodiesel.org/

There, you can see a functioning version of the Milonic DHTML menu. As you may notice, I have two menus on this page... the menu in the orange, horizontal bar AND the Admin menu at the top of the page... next to the text links.

The tricky part... using Coldfusion, I need to ONLY show the Admin menu if the user is logged in and an admin. Checking for that is easy, implementing it into my menu system has been a deal harder. Currently, the admin menu shows whether the user is logged in or not, and is admin or not.

What I've done so far...
I changed the suffix from _date.js to _data.cfm and changed the <script> callout to reflect this change. I also fooled around with adding CFIF & CFOUTPUT statement to the _data.cfm file, but everytime I tried to view the menu it wouldn't be visible, and a status of "Error on this page" appears at the bottom of my browser.

Can someone help me? If I wasn't clear enough on this post, please ask... I need to finish this, so I will be around until I do ;P

Cody


Poster: rcranswick
Dated: Friday May 27 2005 - 19:11:37 BST

My website is built using ColdFusion and the menu is dynamically generated. I have some conditions in the menu based on various factors so it's certainly possible to make the menu behave as you expect.

My menu script is in a .cfm file which I call using cfinclude.

What I would try is to have your two menus in separate .cfm files e.g.

adminmenu.cfm and usermenu.cfm for instance.

Then do something like this in your page


Code:
<cfif "check for admin">
  <cfinclude template="adminmenu.cfm">
</cfif>

<cfinclude template="usermenu.cfm">


Obviously this is a very simple example but you might be able to use it.


Poster: Ruth
Dated: Friday May 27 2005 - 19:11:59 BST

Hi Cody,

Just to let you know, I am totally out of my league with any of this, and the person who usually volunteers here and knows this stuff I believe is out of town this week.

John may know what you need and be on later. I note that you have a professional license, so while you wait and see if someone can help you here who knows something about cold fusion and 'maybe' functions, you might contact Milonic directly. I think in your docs you should have an email for support.

I don't know what coldfusion even is, but in the normal sense, I'd think you would need some kind of function that says if logged in, then this menu shows also, else only that one shows. But, that may be out in left field.

Ruth

hmmm...


Poster: mybiodiesel.org
Dated: Friday May 27 2005 - 23:00:04 BST

Hmmm... this should be easy, I know, I've read it in so many places on the forums. My next step is to contact Milonic directly, but I figured I would give another post..

So, this time, I *only* changed the menu_data.js filename to menu_data.cfm and made the appropriate change in the last line of the <script> to:

Code:
<script type="text/javascript" src="menusite/menu_data.cfm"></script>


As of now, I have no coldfusion programming in the _data.cfm file.. it is identical to the .js version, with the exception of the suffix change. Also, I have no <CFIF> statements in my page yet, but still, it does not pull anything up.. and gives me the error. I change the suffix back to .js in both places and it works beautifully.

I must be missing something...

Cody


Poster: mybiodiesel.org
Dated: Friday May 27 2005 - 23:17:27 BST

Hot damn, I got it! Thanks to all for your help...

Feel free to visit... http://www.mybiodiesel.org/

The site is new, still in its infancy... but it will grow, keep your eyes open for biodiesel.

Thanks again,
Cody Rush
mybiodiesel __at__ gmail.com


Poster: Ruth
Dated: Saturday May 28 2005 - 0:33:50 BST

Hi Cody,

I like your colors. If it wouldn't be too much trouble, i.e. if it is not really really invovled, could tell me what you did? That way if anyone else has the problem and checks the forum they would get the info. [and just as an aside, I'd know one thing about cold fusion :lol: ]

Ruth