|
Two questions:
1. Is there a best practice for generating cookie
trails using the site layout model?
I have implemented a cookie trail (home >
section1 > section1.1 > etc.) using the site model as
follows.
<!--- Get information for
this section --->
<cfa_siteElementGet dataSource="#request.cfa.datasource.dsn#" elementID="#currentSectionID#" r_stElement="stSection" > <!--- Get history using parentCompositionID of section site elements, starting with the current element ---> <cfscript> bGetParent = 1; tempParentID = stSection.parentCompositionID; aParentHistory = ArrayNew(1);
</cfscript>
<cfloop condition="bGetParent"> <!--- Grab parent site element ---> <cfa_siteElementGet dataSource="#request.cfa.datasource.dsn#" elementID="#tempParentID#" r_stElement="currentParent" > <!--- Check for it's composition type, if it's a section, add it to our history array, otherwise kill the loop ---> <cfset bGetParent = 0> <cfif currentParent.compositionType eq "Section"> <cfscript> ArrayAppend( aParentHistory, currentParent ); tempParentID = currentParent.parentCompositionID; bGetParent = 1; </cfscript> </cfif> </cfloop> Once the array of parent elements has been built it
can be looped over for a variety of location or cookie trail displays. I started
off by attempting to use cfa_siteElementGetParents, which returned a collection
of unsorted parent elements that didn't appear to be terribly useful but I'm
curious if there are more elegant approaches to the cookie trail problem
floating around.
2. Programmatically creating sections.
Is it possible to generate site sections
programmatically? I can't find anything in the Spectra API for this, but the
Webtop performs this action. If anyone has experience with programatically
creating sections in the site layout model, please let me know how you went
about accomplishing this.
Cheers,
Seth
seth hodgson
[engineering specialist] impossible, inc. www.impossible.com
805.560.0508 x 230 |
- RE: Cookie trails based on site layout model Seth Hodgson
- RE: Cookie trails based on site layout model Benjamin Elmore
