After many hours, I finally gave up on trying to display a custom type through a container. I tried the aInvocations way as well as calling getDisplay directly, and was not able to get this to work. For what it's worth. I'm going to move away from it for awhile and reapproach it later :(
It's pretty straight forward. This is taken from the news rule:
<cfloop query="qGetNews">
<cfscript>
stInvoke = structNew();
stInvoke.objectID = qGetNews.objectID;
stInvoke.typename = application.types.dmNews.typePath;
stInvoke.method = stObj.displayMethod;
arrayAppend(request.aInvocations,stInvoke);
</cfscript>
</cfloop>So all you need to do is create a structure that has the objectid, typename and displaymethod for each object you want to display with your rule. These structures are appended to the request.aInvocations array which then executes the display method for each of these objects in the order they were placed in the aInvocations array and with the displayMethod chosen.
Now I've noticed not all core rules or my example rules in the walkthrough are using this best practice. I have updated the core rules and will eventually update my walkthrough, but for the time being the execute method for ruleGalleryListing could be something like this:
<cfloop query="qGetGalleries">
<cfscript>
stInvoke = structNew();
stInvoke.objectID = qGetGalleries.objectID;
stInvoke.typename = application.types.bsGallery.typePath;
stInvoke.method = stObj.displayMethod;
arrayAppend(request.aInvocations,stInvoke);
</cfscript>
</cfloop>Almost identical to the news rule. You can also place pagination, intro text, table layouts etc into the aInvocations array, just make sure you put in the correct spot within the array, ie if you want your intro text to be shown before your object listing, your would first do this:
<cfif len(trim(stObj.intro)) AND qGetNews.recordCount>
<cfset tmp = arrayAppend(request.aInvocations,stObj.intro)>
</cfif>then loop over the query as above.
Hope that helps :)
-Brendan http://farcry.daemon.com.au
--- You are currently subscribed to farcry-dev as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
