View post processing functions were added in the FarCry 6.2.3 release.
Oh, and ever tried to man handle a large embed in a rich text editor like tinyMCE? It can be more than a bit messy.
One seriously cool solution is to post-process your content. Have contributors add URLs into their content and then let the view automatically determine what the right embed should be.
Great news!
As of 6.2.3. Post processing can be added to a webskin using the "postprocess", and those transformations will be applied before the webskin is cached:
<!--- @@postprocess: youtube(width=720,height=405);gist --->
This can be applied more selectively with a function or a tag:
<!--- using a function call ---> <cfset result = application.fc.lib.postprocess.apply(stObj.body,"youtube(width=720,height=405);gist")> <!--- using a custom tag call from the ./tags/webskin library ---> <skin:postprocess functions="youtube(width=720,height=405);gist">#stObj.body#</skin:postprocess>
The function strings must be a semi-colon (;) separated list of functions in the form:
[libraryname.]function[(arg1=val1,arg2=val2)]
With:
- an optional library name (this is the name of a component in the lib package in core, your project, or any plugin)
- optional arguments (must be named)
These functions have been included in core by default:
- youtube([width],[height])
- vimeo([width],[height])
- gist
- removewhitespace
You can add your own project specific post-processing functions by creating a ./packages/lib/postprocess.cfc component and extending ./core/packages/lib/postprocess.cfc from the core framework.
Enjoy!