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

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
mybiodiesel.org
Beginner
Beginner
Posts: 3
Joined: Fri May 27, 2005 6:12 pm
Contact:

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

Post by mybiodiesel.org »

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
rcranswick
Super Advanced
Super Advanced
Posts: 62
Joined: Tue Aug 19, 2003 2:14 pm
Location: Bermuda
Contact:

Post by rcranswick »

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: Select all

<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.
Richard Cranswick
CCS Group Limited
Bermuda
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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
mybiodiesel.org
Beginner
Beginner
Posts: 3
Joined: Fri May 27, 2005 6:12 pm
Contact:

hmmm...

Post by mybiodiesel.org »

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: Select all

<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
mybiodiesel.org
Beginner
Beginner
Posts: 3
Joined: Fri May 27, 2005 6:12 pm
Contact:

Post by mybiodiesel.org »

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@gmail.com
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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
Post Reply