On 16/01/2010, at 10:39 AM, Chris Roth wrote:
I'd like to create a rule that allows the user to pick from the
> related images of the dmhtml object the rule is being applied to..
> 
>       <cfproperty ftSeq="1" ftFieldset="Images" name="aImages" type="array"
> default="" hint="The list of images to be displayed in the library
> pick list" ftLabel="Images" ftJoin="dmImage" />
> 
> I think I can use: ftLibraryData  and ftLibraryDataTypename  but I am
> not quite sure how to write the query

Details about librarydata methods here:
http://docs.farcrycms.org/display/FCDEV50/Library+Element

Add this method to the rule, and stick in your ftlibrarydata metadata to point 
to it:

<cffunction name="getImages" access="public" output="false" returntype="query" 
hint="Return images.">
  <cfargument name="primaryID" type="uuid" required="true" hint="ObjectID of 
the rule we are in." />
  <cfset var q = queryNew("objectid") />

  <cfquery datasource="#application.dsn#" name="q">
  SELECT data AS objectid 
  FROM dmHTML_aObjectIDs
  WHERE typename = 'dmImage'
  AND parentid = '#request.stobj.objectid#'
  </cfquery>

  <cfreturn q />
</cffunction>

Totally untested and off the top of my head but hopefully it gets you started!

-- geoff
http://www.daemon.com.au/
-- 
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: [email protected]
To unsubscribe, email: [email protected]
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry

Reply via email to