Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Passing Dynamic URL Parameters
Russell411
Junior Member

Posts: 6
Registered: 4/3/2007
Location: California
Member Is Offline
posted on 4/3/2007 at 06:38 PM Reply With Quote
Passing Dynamic URL Parameters


Hi,

I hope you can point out what I'm doing wrong. I need to pass additional URL parameters/variables through my menu.

From a previous post (http://www.softcomplex.com/forum/viewthread_414/), I understand that it should be pretty easy:

1. Simply copy my menu_items.js file to a new file with my dynamic version extension (in my case with Coldfusion, it becomes menu_items.cfm, for PHPers it'd be menu_items.php, asp = menu_items.asp, etc.).

2. Then on the page where the menu is called, I changed the line reading:
<script language="JavaScript" src="menu_items.js">
to:
<script language="JavaScript" src="menu_items.cfm">

This makes my menu not appear at all (the two files are identical, I haven't added anything dynamic yet)... and other than whitespace, both render the same in my browser as well.

Thanks in advance for any help,

Russell Schutte

P.S. For those who are searching the forum, you can then in your menu_items.js folder change your URL to a dynamic version:
['Support', 'index.cfm?PageID=2']

could be (Coldfusion example):
['Support', 'index.cfm?PageID=2&URLVariable=#UserID#']

or (PHP Example):
['Support', 'index.cfm?PageID=2&URLVariable=$UserID']
View User's Profile View All Posts By User U2U Member
Russell411
Junior Member

Posts: 6
Registered: 4/3/2007
Location: California
Member Is Offline
posted on 4/3/2007 at 08:19 PM Reply With Quote

Aha,

I've discovered a little something - by viewing source. There is indeed a difference... Since I'm running this on my development machine - when my CFM page is created, it adds this line to the very top of the file:

<META NAME="ColdFusionMXEdition" CONTENT="ColdFusion DevNet Edition - Not for Production Use.">

I presume that is what's making my menu barf. :-)


So, I've got that one solved... Now I'm wondering, if I change my site to the ColdFusion Database Method (http://www.softcomplex.com/forum/viewthread_1966/), is it possible to use these same URL parameters?

For some reason, I think it might work, but would need the use of the EVALUATE function or something?

Thanks again,

Russell Schutte
View User's Profile View All Posts By User U2U Member
Russell411
Junior Member

Posts: 6
Registered: 4/3/2007
Location: California
Member Is Offline
posted on 4/3/2007 at 09:02 PM Reply With Quote

Darn,

I thought I had it... This simple little thing has taken me half a day!

Now I've got it working - mostly. Hopefully there's a ColdFusion person out there who can explain what's going on...

In my application.cfm file (run with each page request), I am testing for the existence of a VisitorID (URL passed). If one doesn't exist, I create a local VisitorID which will be passed with all future page requests.

My problem: The menu seems to be initiating it's own page request - since it gets a new VisitorID with every page request. It somehow doesn't recognize the already existing VisitorID (even when passed through the URL) and application.cfm gives it a new VisitorID every time.

So, when I browse a page - in the same page my menu has a unique VisitorID - while the page itself shows the VisitorID that was passed in the URL as a parameter.

Any ideas on this one?

Thanks,

Russell Schutte
View User's Profile View All Posts By User U2U Member
Russell411
Junior Member

Posts: 6
Registered: 4/3/2007
Location: California
Member Is Offline
posted on 4/3/2007 at 09:38 PM Reply With Quote

Boy, I hope someone reads this... It should save the next ColdFusion'er a lot of time.

I still have no idea why the menu seems to generate it's own session, but I have figured out a workaround.

My menu_items.cfm file looks like this:
<cfsetting showdebugoutput="No">
<cfoutput>
/* Tigra Menu items structure */
var MENU_ITEMS = [
['Menu Header', 'index.cfm?PageID=32&VisitorID=#Session.VisitorID#', null,
['SubMenu Item One', 'index.cfm?PageID=2&VisitorID=#Session.VisitorID#']
['SubMenu Item Two', 'index.cfm?PageID=2&VisitorID=#Session.VisitorID#']
]
];
</cfoutput>

My application.cfm file looks like this:

<CFPARAM name="Session.VisitorID" default="">
<cfif Session.VisitorID IS "">
<cfset Session.VisitorID = RandRange(1, 2000000000)>
</cfif>
<cfset VisitorID = Session.VisitorID>

For whatever reason, reassigning Session.VisitorID to VisitorID (the last line) seems to make it work - even though a new session seems to be generated when the menu generates....

So, finally... any ideas how to proceed in putting all of this into the database using the ColdFusion Database Method (http://www.softcomplex.com/forum/viewthread_1966/)? I'd really like to have everything in my database.

But, it's notoriously troublesome to try to run ColdFusion code stored in a database. Has anyone gotten this working to generate the menu with additional URL parameters???

Thanks again,

Russell Schutte
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page Tigra Menu
Product Demonstrations Live Demos:
Traditional Blue
White Steps
Inner HTML
All Together
Frames Targeting
Free Download Free Download
Free Download Menu Builders
Online Builder
Builder for Windows
Product Documentation Documentation:
Documenation Page
Change Log
Menus Comparison Table
Support Forum Support Forum
 
Tigra Menu PRO
Product Demonstrations Live Demos
Alignment & Multimenus
Unlimited Depth
Item sizing and positioning
Inner HTML
Frames, Targeting
Static Positioning
Free Download Menu Builders
Online Builder
Product Documentation Documentation
Documenation Page
Tigra Menu PRO FAQ
Change Log
Menus Comparison Table
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 
Product Page Tigra Menu GOLD
Functionality demos Functionality demos
Multiple
Cross-framed
Select-boxes
Effects
Design demos Design demos
Icons & arrows
Idea!
Hi there!
Matrix
MS Style
XP Style
Dots
3D-Buttons
Product Documentation Documentation
Documenation Page
Change Log
Menus Comparison Table
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004