Here is the guts of the rule I created - the whole thing is for FC2 so I wont bother publishing it.
request.stObj.AOBJECTIDS[i] is all the files uploaded to the curent page.
<cffunction access="public" name="execute" output="true">
<cfargument name="objectID" required="Yes" type="uuid" default="">
<cfargument name="dsn" required="false" type="string" default="#application.dsn#">
<cfset var i = 1>
<cfset var fileCount = 0>
<cfset var stObj = this.getData(arguments.objectid)>
<cfset var stInvoke = structNew()>
<cfset var iNumberOfPages = 1>
<cfset var startrow = 1>
<cfset var endrow = 1>
<cfparam name="request.mode.lValidStatus" default="approved">
<cfif len(trim(stObj.intro)) >
<cfset stObj.intro = '<p>#stObj.intro#</p>' />
<cfset tmp = arrayAppend(request.aInvocations,stObj.intro)>
</cfif>
<cfset fileCount = arrayLen( request.stObj.AOBJECTIDS) />
<cfloop index="i" from="1" to="#fileCount#">
<cfscript>
stInvoke = structNew();
stInvoke.objectID = request.stObj.AOBJECTIDS[i];
stInvoke.typename = application.types.dmFile.typePath;
stInvoke.method = stObj.displayMethod;
arrayAppend( request.aInvocations,stInvoke);
</cfscript>
</cfloop>
<cfif len(trim(stObj.suffix))>
<cfset stObj.suffix = '<p>#stObj.suffix#</p>' />
<cfset tmp = arrayAppend(request.aInvocations,stObj.suffix)>
</cfif>
</cffunction>
On 8/15/06, Whiterod, David (PIRSA)
<[EMAIL PROTECTED]> wrote:
Hi Andrew,
I don't have a rule to display associated file objects but have just
added the custom publishing 'ruleFile' to the WIKI's Developers'
Exchange [1].
Based on the core's ruleNews but it's a custom publishing rule to
display dmFile objects [2].
[This rule also adds the ability to choose a field (document date or
title) to order by and a order direction - this might be a nice addition
to the core's news rule]
A new display associated file objects rule could also use the same
displayTeaser templates used by ruleFile
Cheers
David
[1]
http://docs.farcrycms.org:8080/confluence/display/FCDEV30/Developers%27+
Exchange
[2] http://docs.farcrycms.org:8080/confluence/display/FCDEV30/ruleFile
________________________________
From: [email protected] [mailto:[email protected]]
On Behalf Of Andrew Mercer
Sent: Monday, 14 August 2006 12:22 PM
To: [email protected]
Subject: [farcry-dev] farcry rule :: associated files
Does any one have a rule that displays a list of links for files
uploaded to a dmHTML object?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/farcry-dev
-~----------~----~----~----~------~----~------~--~---
