919 - 926 - 9847

Been awhile. New FarCry hack for the objectadmin

Under the new 6.x builds of FarCry, and object edit overlay (which is quite handy at times) always pops up on object edit. However, this can be tedious at points. Want to change that behavior? Well, here's one way to do so.

1. Create an edit.cfm for your content type, in this case mdwArticles. In this code have a process form that looks like this (note the return="true"):


<ft:processform action="Save" exit="true" return="true">
<ft:processformobjects typename="mdwArticles" />
</ft:processform>

2. Modify (or make a copy in your project being the better answer) /farcry/core/tags/formtools/processform.cfm:

Add the webskin tag


<cfimport taglib="/farcry/core/tags/webskin" prefix="skin" />

Add a new attribute


<cfparam name="attributes.Return" default="false"><!--- Return to objectadmin --->

After the code block (don't forget the if)


<!--- Return to the objectadmin --->
<cfif structKeyExists(attributes, "Return") AND attributes.return EQ 'true'>
<cfset attributes.exit = true />
<cfset stLocal.onExitProcess = structNew() />
<cfset stLocal.onExitProcess.Type = "Return" />
<cfset stLocal.onExitProcess.Content = "" />
</cfif>

And finally, you need a case to handle the return ()


<cfcase value="Return">
<cfif structKeyExists(stLocal.stOnExit, "Content")>
<skin:onReady>
<cfoutput>

parent.$fc.objectAdminActionDiv.dialog('close');
</cfoutput>
</skin:onReady>
</cfif>
</cfcase>

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Geoff Bowers's Gravatar Great work! Maybe this behaviour ought to be an attribute you can nominate on the "object admin" grid. I guess it might also be handy to have a similar option assigned to the content type for the tray behaviour too.
# Posted By Geoff Bowers | 7/1/11 1:04 AM
Matthew Williams's Gravatar It would indeed be cool if you set this in objectadmin. I have a theory to test on that yet... processform is already looking for caller.onExitProcess. I'll have a poke about to see if setting that struct in the calling tag will pass through all the required settings.
# Posted By Matthew Williams | 7/1/11 8:51 AM