<chapter name="chp1>
<page>
<name>
pg1
</name>
<url>
pageABC.cfm
</url>
<otherattribute>
somevalue
</otherattribute>
</page>
<page>
<name>
pg2
</name>
<url>
pageGHI.cfm
</url>
<otherattribute>
somevalue
</otherattribute>
</page>
<page>
<name>
pg3
</name>
<url>
pageTUV.cfm
</url>
<otherattribute>
somevalue
</otherattribute>
</page>
</chapter>
<chapter name="chp2>
<page>
<name>
pg1
</name>
<url>
pageJKL.cfm
</url>
<otherattribute>
somevalue
</otherattribute>
</page>
<page>
<name>
pg2
</name>
<url>
pageXYZ.cfm
</url>
<otherattribute>
somevalue
</otherattribute>
</page>
</chapter>
<!--- define the previous current and next pages in the sequence --->
<!--- some variables to cut down on long if condition checks later in the page --->
<cfset arrIndex=0>
<cfset hasPrevious =false>
<cfset hasNext =false>
<!--- look for this page in the array - search by value --->
<cfloop from="1" to="#arrayLen(hNavArray)#" index="idx">
<cfset myvar= structFindValue(hNavArray[idx], listlast(GetBaseTemplatePath(),'/\'))> <!--- page name - always unique --->
<cfif arrayLen(myVar)> <!--- found page name value - mark where found --->
<cfset arrIndex=#idx#>
</cfif>
</cfloop>
<!--- the currentpage was found --->
<!--- copy the found page structure to the current page --->
<cfif arrIndex>
<cfset currentPage=structCopy(hNavArray[arrIndex])>
<cfset currpage= "#currentpage.pageurl#">
<cfset primarytitle = #currentpage.pagetitle#>
<cfset secondarytitle = #currentpage.secondarytitle#>
<cfset spagetitle = "#primarytitle#">
<cfif len(secondarytitle)>
<cfset spagetitle ="#spagetitle# - #secondarytitle#">
</cfif>
<cfset template = #currentpage.pagetemplate#>
</cfif>
<!--- if there is a previous page set it here --->
<cfif arrIndex GT 1>
<cfset previousPage=structCopy(hNavArray[arrIndex-1])>
<cfset prevurl="/AR2008/#nextPage.pageurl#">
<cfset prevtitle="#nextPage.alttext#">
<cfset hasPrevious =true>
</cfif>
<!--- if there is a next page set it here --->
<cfif arrIndex LT arrayLen(hNavArray)>
<cfset nextPage=structCopy(hNavArray[arrIndex+1])>
<cfset nexturl="/AR2008/#nextPage.pageurl#">
<cfset nexttitle="#nextPage.alttext#">
<cfset hasNext=true>
</cfif>
<cfset thisPage = listlast(GetBaseTemplatePath(),'/\')> <!--- remember page to avoid recalculating --->
<cfloop from="1" to="#arrayLen(hNavArray)#" index="idx">
<cfif hNavArray[idx].pageURL is thisPage> <!---- only check the one structure for a match, save time ---->
<cfset arrIndex = idx>
<cfbreak> <!----found it, so stop looping --->
</cfif>
</cfloop>
<cfset currentPage=hNavArray[arrIndex]> <!--- no need to COPY the structe --->
Now you could just reference this..
<cfoutput>#currentpage.pageurl#</cfoutput>
Instead of copying again...