Last active
December 18, 2017 10:54
-
-
Save stevewithington/683bc2c18e7373e956a2 to your computer and use it in GitHub Desktop.
Mura CMS : How to reference information about a content item after it's been saved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
public any function onAfterContentSave($) { | |
// reference the new bean that was created | |
var newBean = arguments.$.event('contentBean'); | |
// reference to the OLD bean | |
var oldBean = arguments.$.event('activeBean'); // can also use 'currentBean' to access the same bean | |
// you can now reference any of the attributes of the new bean ... | |
WriteDump(var=newBean.getAllValues(), abort=true); | |
// keep in mind that the content has already been saved, so you can't display any messaging anymore! | |
// however, you can do some additional manipulation of the content such as parse a PDF, save children, etc. | |
} | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is the 'activeBean' null if the content has just been created?