Results 1 to 2 of 2
Thread: Quick ColdFusion Question
Jan 29, 2013, 15:18 #1
- Join Date
- Jul 2011
- 0 Post(s)
- 0 Thread(s)
Quick ColdFusion Question
Quick ColdFusion Question, I'm helping someone with their real estate website, which uses CF and I am not familiar with CF at all so I was hoping someone could help.
Basically, below is most of the header and navigation:
On the Navigation, it's set to change the class to "cur" based on whichever page you're on. Simple enough right?
The only problem is, with the way the code is written, it sets the "Property Search" page to the current class any time it is on a page that is /idx.cfm. (Which are dynamically created pages)
So my thought, since I only have the issues in the 2 pages (code shown below), I could write a statement like:
IF *Page Title IS* "My Listings" set link class to "cur" or if URL, but it would need to pass the values after the question mark...
I'm not exactly sure what the best approach is.. any ideas?
Code is below:
... ... ... <div id="header" class="mod-con"> <h1 id="logo"><a href="/index.cfm"><img src="/image/logo.png" alt="logo" /></a></h1> <cfset pageList=" /index.cfm|Home, /idx.cfm|Property Search, /idx.cfm?action=frm.select-map&load=1&agent=true&listingSystem=austin&state=TX|My Listings, /exclusives/generic_officesearch.cfm|Featured Listings, /about.cfm|About, /contact.cfm|Contact "> <cfset loopct = 1> <ul id="main-menu"> <cfloop list="#pageList#" index="q"> <cfoutput> <cfset thisLink=trim(listFirst(q, '|'))> <cfset thisLinkText=trim(listLast(q,'|'))> <li> <strong><a href="#thisLink#"<cfif cgi.SCRIPT_NAME contains "#thisLink#"> class="cur"</cfif><cfif loopct eq 1><cfelseif loopCt eq listLen(pageList)></cfif>> #thisLinkText#</a></strong> </li> </cfoutput> <cfset loopCt = loopCt + 1> </cfloop> </ul> </div> ... ... ...