Formtools property dependency

5 views
Skip to first unread message

Xiaofeng Liu

unread,
May 14, 2012, 3:05:18 AM5/14/12
to farcr...@googlegroups.com
Hi guys,

I have 2 properties in my custom type adverts.cfc:

<cfproperty ftSeq="10" ftFieldset="Advertisement" ftLabel="Place" name="place" type="string" default="" ftType="list" ftList="home-page-right:Home Page Ad (National Promotional Activity),department-page-right:Department Page Ad">
        <cfproperty ftSeq="11" ftFieldset="Advertisement" ftLabel="Image" name="image" type="string" ftType="image" default="" ftDestination="/images/advertisements" ftHint="<br />*Use image with below dimensions otherwise it might stretch when display.<br /><br />Home Page Ad: 286px x 209px<br />Department Page Ad: 242px x 200px">

Now I need to add:

ftImageHeight  and ftImageWidth so I can resize the ad images from their source images. What I would like to achieve is, depending on the value of the 'Place' property (can either be home page ad or department page ad), to set the ftImageHeight and ftImageWidth accordingly.

How can I do that? 

Any help or pointing to a direction would be appreciated.

Cheers,

--
Best regards,

Xiaofeng,^_^

Blair McKenzie

unread,
May 14, 2012, 3:14:39 AM5/14/12
to farcr...@googlegroups.com
We would probably three properties:
- an imageSource, which has the original image (this could be an image property, or a UUID property that joins the dmImage library)
- an imageHome, which has ftSource="imageSource"
- an imageDepartment, with ftSource="imageSource"

Then add code to the template to use whichever image is appropriate. There isn't an easy way to change image dimensions dynamically.

Blair

--
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcr...@googlegroups.com
To unsubscribe, email: farcry-dev+...@googlegroups.com
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry

Reply all
Reply to author
Forward
0 new messages