I currently am using a getBreadcrumbs CFC as seen below...
The output that generates for a 2nd level category is:
source: <a href="index.cfm?id=1">Advertising &
Marketing</a> > Direct Marketing
HTML output: "Advertising & Marketing > Direct Marketing"
The issue I am having is that Advertising & Marketing is linked, but direct
marketing is not.
Can someone please advise on how I can make both Advertising & Marketing, and
Direct Marketing both link to their respective paths?
Thanks in advanced for any guidance you can provide...
CODE:
<!--- BEGIN getBreadcrumbs() method --->
<cffunction name="getBreadcrumbs" hint="Returns a string containing the
breadcrumb trail to the input child" returntype="string" output="true"
access="public">
<!--- set the method arguments --->
<cfargument name="childID" hint="The ID of the child whose
parent is being searched for" required="yes" type="string" />
<cfargument name="pageName" hint="The name of the page
(template/script) to be used in building the links; defaults to 'index.cfm'"
required="no" type="string" default="index.cfm" />
<cfscript>
var strOut = "";
var qParent = "";
var link = "";
link = "<a href=""" & arguments.pageName &
"?id=[parentField]"">[dspField]</a>";
if (NOT structKeyExists(variables, "childID")) {
variables.childID = arguments.childID;
}
qParent = getParent(arguments.childID);
if (qParent[getProperty('parentField')][1] NEQ
variables.childID) {
link = replace(link, "[parentField]",
qParent[getProperty('parentField')][1]);
link = replace(link, "[dspField]",
qParent[getProperty('dspField')][1]);
} else {
link = qParent[getProperty('dspField')][1];
}
if (isNumeric(qParent[getProperty('childOfField')][1])
AND qParent[getProperty('childOfField')][1] NEQ 0) {
strOut =
getBreadcrumbs(qParent[getProperty('childOfField')][1], arguments.pageName) &
" > " & link & strOut;
} else {
strOut = link & strOut;
}
return strOut;
</cfscript>
</cffunction>
<!--- END getBreadcrumbs() method --->
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion is delivering applications solutions at at top companies
around the world in government. Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284686
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4