Glad to help Jaci. Sorry about the typo(s)! I'm a marginal speller and a terrible proofreader ;-)
~tom On Mon, 14 Mar 2005 09:54:35 -0500, Jaci Chesnes <[EMAIL PROTECTED]> wrote: > Many Many MANY thanks to both Andrew and Tom for their genius. Between > the two posts and an additional script to truncate the number of > characters in the option it works beautifully. For anyone using Toms > script in the future note that where it says #arrayLen(stObj.aOjectids)# > aObjectsids is missing the "b". Other than that it worked with no > modification. Thanks again to both of you. The Cfdump tip that Andrew > gave, helped me find the spelling error. I'm very pleased. > > Jaci > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Tom > Cornilliac > Sent: Friday, March 11, 2005 5:46 PM > To: FarCry Developers > Subject: [farcry-dev] Re: node in files to populate select > > OK...I see the problems > > First, you cannot use getDescendants() in this case as it's only going > to return dmNavigation objects below the objectid given as an > argument. > > Second, "filename" is not a valid column for this method as > getDescendants queries against "nested_tree_objects" in the Db and > that table doesn't have a filename column. > > So as I said before, you're existing code is most definately throwing > an exception and your just not seeing it in the output. If I was you > I'd develop this feature outside of the _primaryNav template to make > debugging easier. Once it's working you can drop it in place. > > Ok so back to the problem. Here's what you need to do: > > <cfscript> > //get the properties of application.navid.guides > oNav = createObject("component", > application.types.dmNavigation.typePath); > stObj = oNav.getData(application.navid.guides); > </cfscript> > > <!--- > Check the array length of stObj.aObjectids and loop over it if it's not > empty > aObjectids contains your PDF files that are under Guides > ---> > <cfif arrayLen(stObj.aObjectids)> > <cfoutput> > <form action="../"> > <b>An Agents Guides To...</b><br> > <select onchange="parseNavigation(this)"> > <option>Choose a guide</option> > </cfoutput> > <!--- Loop over stObj.aObjectids ---> > <cfloop from="1" > to="#arrayLen(stObj.aOjectids)#" index="i"> > <!--- Get the properties of the file > ---> > <cfset oFile = createObject("component", > application.types.dmFile.typePath)> > <cfset stFileProps = > oFile.getData(stObj.aObjectids[i])> > <cfoutput><option > value="files/#stFileProps.filename#">#stFileProps.title#</option></cfout > put> > </cfloop> > <cfoutput> > </select> > </form> > </cfoutput> > </cfif> > > I didn't test this but it should work. Let me know how this works for > you. > > ~tom > > On Fri, 11 Mar 2005 16:39:11 -0500, Jaci Chesnes > <[EMAIL PROTECTED]> wrote: > > The problem is that its every page because I'm trying do this on the > > _primaryNav.cfm > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Tom > > Cornilliac > > Sent: Friday, March 11, 2005 4:25 PM > > To: FarCry Developers > > Subject: [farcry-dev] Re: node in files to populate select > > > > I'll take a look at your sample code in a sec but real quickly....a > > lot of times when you see page content just "disappear" it means that > > there's an error and Farcry has silently caught the exception. Try > > adding "debug=1" to the URL of the offending page. If there is an > > error you should see the exception with this. > > > > ~tom > > > > On Fri, 11 Mar 2005 15:28:34 -0500, Jaci Chesnes > > <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > I have created a node in the file section of the farcry site called > > guides. > > > What I want is to populate a select box with all of the pdfs that > are > > > present in this node and when selected pop them open in a new > window. > > This > > > is what I have and its causing the content for the entire page to > > disappear > > > can someone tell me what need corrected. > > > > > > > > > > > > <cfscript> > > > > > > // get navigation elements to root > > > > > > navFilter=arrayNew(1); > > > > > > navfilter[1]="status IN > > (#listQualify(request.mode.lvalidstatus, > > > "'")#)"; > > > > > > > > > > > > qguides = > > > > > > application.factory.oTree.getdescendants(objectid=application.navid.guid > > es, > > > depth=1, afilter=navFilter, lColumns='filename'); > > > > > > </cfscript> > > > > > > > > > > > > > > > > > > <form action="../"> > > > > > > <b>An Agents Guides To...</b><br> > > > > > > <select onchange="parseNavigation(this)"> > > > > > > <option>Choose a guide</option> > > > > > > <cfloop query="qguides"><option > > > value="files/#qguides.filename#">#qguides.lNavIDAlias #</option> > > > > > > <cfloop> > > > > > > </select> > > > > > > </form> > > > > > > > > > > > > Thanks > > > > > > > > > > > > Jaci --- > > > You are currently subscribed to farcry-dev as: > > [EMAIL PROTECTED] > > > To unsubscribe send a blank email to > > > [EMAIL PROTECTED] Aussie Macromedia > > Developers: > > > http://lists.daemon.com.au/ > > > > --- > > You are currently subscribed to farcry-dev as: [EMAIL PROTECTED] > > To unsubscribe send a blank email to > > [EMAIL PROTECTED] > > Aussie Macromedia Developers: http://lists.daemon.com.au/ > > > > --- > > You are currently subscribed to farcry-dev as: [EMAIL PROTECTED] > > To unsubscribe send a blank email to > [EMAIL PROTECTED] > > Aussie Macromedia Developers: http://lists.daemon.com.au/ > > > > --- > You are currently subscribed to farcry-dev as: [EMAIL PROTECTED] > To unsubscribe send a blank email to > [EMAIL PROTECTED] > Aussie Macromedia Developers: http://lists.daemon.com.au/ > > --- > You are currently subscribed to farcry-dev as: [EMAIL PROTECTED] > To unsubscribe send a blank email to [EMAIL PROTECTED] > Aussie Macromedia Developers: http://lists.daemon.com.au/ > --- You are currently subscribed to farcry-dev as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
