Yeah if I were to rebuild the handpicked rule I would use a regular array property but instead of pointing to several content types it would point to a single custom type. This new type would have two properties, 1. the actual content type you want to display (dmHTML, dmNews, etc) and 2. the webskin to use to display it. This type would serve as an intermediate and would handle loading the actual content object and displaying it using the proper webskin.
So you would have an extra content type in there instead of an extended array. Functionally it would be the same, it would just be slightly more complicated because you have the extra content type. but, when you think about it, it is the similar as the hand picked rule using an extended array... An extended array is simply a "regular" array with extra properties. You get these extra properties by creating a type with a proper name that extends the "ArrayTable" component of core. So, if you have a property called "aObjectIDs" in a custom type called "dmWidgets" then you could create that as an extended array by creating a content type called "dmWidgets_aObjectIDs" that extends "farcry.core.packages.types.arrayTable". So now instead of just having an array of other items and the "seq" value, you can add as many other properties as you like. So, in this example the "webskin" value is stored for each item in the hand picked rule. Without an extended array (or the alternate solution I propose above) you can't store item specific properties. If the "webskin" property was just part of the rule it would apply to ALL the items instead of having the ability to have a webskin specific to each item. Great feature, just is not used a lot so it tends to break when upgrades happen. I recently rewrote a bunch of code that was using extended arrays to use the alternate "intermediate content type" method above to avoid these issues on the future. I doubt I would use an extended array again. On Tuesday, April 16, 2013 1:06:15 PM UTC-4, Might Aswell wrote: > > Hi Sean, > > bummer.. My content managers love the handpicked rule as its so easy to > build out a page of multiple related types and sort them as they see fit.. > switching to a content type based rule certainly limits that capability. > And as you mention it looks like these types of rules can get in trouble, > as I notice that a few of my other "picker" rules (that I based off the > original handpicked rule) no longer work. :( > > That said.. I am a little foggy on "extended" arrays vs just an array.. > > Is there a safe way to build a rule that allows a user to "select" the > object they want and the associated webskin? > > I see the farcrycms plugin "Image Gallery" rule uses an array "aImages" > but I don't see anyway to add a web skin selection? Am i stuck with > one defined webskin for all selected objects? > > Unfortunately the documentation for rules is... sparse (except for a quick > overview post, I think from you).. > > Chris > -- 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 --- You received this message because you are subscribed to the Google Groups "farcry-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
