Quick links is an interesting concept that can be very useful. It just so happens that Farcry is excellent at dynamically generating them.
First of all, the way I’m using quick links is I am putting a select box somewhere in the header. The user selects something from the dropdown and goes there
Let’s go over what we need to make this work…
First, you need a way to create quick links. I have a tutorial available for download about this. Basically, create a new Navigation node under Root called Quick Links (or whatever you want) and set the alias to “quicklinks.” The alias part is very important, what it’s named is not.
Within that Navigation node, create other navigation nodes but do NOT create HTML pages corresponding to them. If you right click on the Node inside the Site tree and select Navigation you will be fine. If you do this through Quick Site Builder you have to make sure to uncheck the part about creating HTML pages. Go into each of the navigation nodes and set the Symbolic Link to one of the pages/nodes you’ve already created. (If you do this in Quick Site Builder you have to go into each node separately. If you create them through the Site Tree you can do it right then.
Quicklinks FAQ
Once you have the nodes set up you need a way to control them. Here is the code that I used for mine. It’s nothing more than a new spin on the navigation classes that are already used all the time. (When I say mine, what I really mean is my boss came up with this and I implemented it so I can’t really take all the credit. Thanks Mark!).
<cfparam name="attributes.navID" default="#request.navID#">
<cfparam name="attributes.depth" default="1">
<cfparam name="attributes.startLevel" default="2">
<cfparam name="attributes.id" default="">
<cfparam name="attributes.bFirst" default="0">
<cfparam name="attributes.bLast" default="0">
<cfparam name="attributes.bActive" default="0">
<cfparam name="attributes.bIncludeHome" default="0">
<cfparam name="attributes.sectionObjectID" default="#request.navID#">
<cfparam name="attributes.functionMethod" default="getDescendants">
<cfparam name="attributes.functionArgs" default="depth=attributes.depth">
<cfparam name="attributes.class" default="">
<cfparam name="attributes.style" default="">
<cfparam name="request.sectionObjectID" default="#request.navID#">
<cfparam name="attributes.diplayStyle" default="unorderedList"> <!--- alink: pipe (|) delimited links --->
<cfif application.config.plugins.fu>
<cfset fu = createObject("component","#application.packagepath#.farcry.fu")>
</cfif>
<!--- // get navigation items --->
<cfset o = createObject("component", "#application.packagepath#.farcry.tree")>
<cfset navFilter=arrayNew(1)>
<cfset navfilter[1]="status IN (#listQualify(request.mode.lvalidstatus, '''')#)">
<cfset qNav = evaluate("o."&attributes.functionMethod&"(objectid=attributes.navID, lColumns='externallink', "&attributes.functionArgs&", afilter=navFilter)")>
<!--- // get ansestors of attributes.navID --->
<cfset qAncestors = o.getAncestors(attributes.navID)>
<cfset lAncestors = valuelist(qAncestors.objectid)>
<cfif attributes.bLast>
<!--- here we get the most right nav so we can add a last class to it if needed --->
<cfquery name="qMaxRight" dbtype="query">
select max(nRight) as maxRight from qNav
</cfquery>
</cfif>
<!--- pipe (|) delimited list of links --->
<cfoutput>
<form id="quickLinks">
<select name="quickLinks" size="1" onchange="document.location=this.options[this.selectedIndex].value">
<option value="##" selected>Quick Links - Jump to:</option>
<option value="##"></option>
</cfoutput>
<cfloop query="qNav">
<cfif application.config.plugins.fu>
<cfset strhref = fu.getFU(qNav.objectid)>
<cfelse>
<cfset strhref = application.url.conjurer & "?objectid=" & qNav.objectid>
</cfif>
<cfoutput><option value="#strhref#">#qNav.objectName#</option></cfoutput>
</cfloop>
<cfoutput></select></form></cfoutput>
Now, wherever you want to put the Quick links select box, add this code:
<skin:quicklinks navID="#application.navid.quicklinks#"
id="firstTier"
depth="1"
bActive="false"
bIncludeHome="false">
I suppose I should mention something else. You have to import the tag library where you put the first set of code. In my case we put it in the farcry_core/tags/webskin directory. This is probably not the best place for it but it’s not hurting anything yet. It would also likely work seamlessly in the
And there you have it. I’m quickly fading at 5:30pm for some reason so I hope I didn’t miss anything. Too much gaming last night!

Related Articles
No user responded in this post
Leave A Reply