Reply to topic
creating breadcrumb navigation in CFMX
Citizen1200


Joined: 07 Jul 2004
Posts: 54
Location: San Diego
Reply with quote
I'm trying to create a breadcrumb navigation system for my website, but I can't seem to find any tutorials out on the web for how to do this in CFMX. It seems like this should be fairly simple and something that someone has done before - I'd rather not re-invent the wheel if possible. Does anyone know of any links to sites with pre-canned code or tutorials? Question
bobclingan
Forum Regular

Joined: 16 Sep 2004
Posts: 271
Location: Abingdon, MD
Reply with quote
Had this lying around, with a few tweaks I'm sure it might be useful...

Code:

<!---************************************************************************************************************
* Breadcrumb.cfm
* -----------------
*
*
* Parameters
* ----------
*  INPUT (M)andatory (C)onditional
* ClassStyle (C) - class to use for the breadcrumb - default is ""
* Seperator (C) - seperator to use between trail - default is &nbsp;&raquo;&nbsp;
*  EnableLinks (C) - enables links for the trail - default is yes
* onMouseOver (C) - javascript for the link - default is ""
* onMouseOut (C) - javascript for the link - default is ""
*
* OUTPUT
* ------
*  None
*
* HTML Output
* -----------
* HTML table that displays a breadcrumb for easy navigation
*
* Syntax (Examples)
* ----------------
* <cf_breadcrumb ClassStyle="breadcrumb">
* <cf_breadcrumb>
*
* Known Issues
* ------------
* None
*
*************************************************************************************************************--->

<cfparam name="Attributes.ClassStyle" default="">
<cfparam name="Attributes.Seperator" default="&nbsp;&raquo;&nbsp;">
<cfparam name="Attributes.EnableLinks" default="Yes">
<cfparam name="Attributes.onMouseOver" default="">
<cfparam name="Attributes.onMouseOut" default="">
<cfset Variables.URL = "">
<cfset ListLastElement = ListLen(CGI.PATH_INFO, "/")>
<cfset PathList = ListDeleteAt(CGI.PATH_INFO, "#ListLastElement#", "/")>
<cfsetting showdebugoutput="No" enablecfoutputonly="yes">

<cfoutput>
 <table cellpadding="0" cellspacing="0" border="0">
  <tr>
   <td width="28"><img src="#Client.IncludePath#IMAGES/space.gif" height="27" /></td>
   <td class="#Attributes.ClassStyle#">
    <cfif Attributes.EnableLinks is "Yes"><a href="http://#CGI.HTTP_HOST#" class="#Attributes.ClassStyle#"></cfif>
     home
    <cfif Attributes.EnableLinks is "Yes"></a></cfif>
   </td>
   <cfloop list="#PathList#" index="PATH_INFO" delimiters="/">
    <cfset Variables.URL = Variables.URL & "/" & Variables.PATH_INFO>
    <td>
     <table cellpadding="0" cellspacing="0" border="0">
      <tr>
       <td class="#Attributes.ClassStyle#">#Attributes.Seperator#</td>
       <td class="#Attributes.ClassStyle#">
        <cfif Attributes.EnableLinks is "Yes"><a href="#Variables.URL#" class="#Attributes.ClassStyle#"></cfif>
         #Variables.PATH_INFO#
        <cfif Attributes.EnableLinks is "Yes"></a></cfif>
       </td>
      </tr>
     </table>
    </td>
   </cfloop>
  </tr>
 </table>
</cfoutput>
<cfsetting showdebugoutput="No" enablecfoutputonly="no">
[/code]
Citizen1200


Joined: 07 Jul 2004
Posts: 54
Location: San Diego
Reply with quote
thanks! Very Happy
creating breadcrumb navigation in CFMX
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic