Is there a way to make this @@postprocess work?

Hi,

I want to have different post processing settings for desktop, mobile, tablets without creating mobile or tablet specific webskins. What I was attempting was:

Set desktop, mobile, tablet settings in a postprocess config area in the webtop
On the displayBody.cfm skins have something like:

@@postprocess: application.fapi.getConfig("postprocess",application.fc.lib.device.getDeviceType(),"youtube(width=568,height=320);vimeo(width=568,height=320);vine()")

Which would lookup the settings based on the current device type. The last part is just in case something was wrong with the lookup.

If I dump the above fapi code it is outputting what I expect it to however it doesn’t work as a part of @@postprocess. Is there any way to get this to work? Or am I approaching this all wrong?

Regards
Mark

In that case you need to use the tag:

<skin:postprocess
functions='#application.fapi.getConfig("postprocess",application.fc.lib.device.getDeviceType(),"youtube(width=568,height=320);vimeo(width=568,height=320);vine()")#'>
#stObj.body#
</skin:postprocess>

Blair

1 Like

Hi Blair,

Thanks for the reply. I also realised I could change stObj.body to:

#application.fc.lib.postprocess.apply(stObj.body,application.fapi.getConfig("postprocess",application.fc.lib.device.getDeviceType()))#

Is there any advantage/disadvantage to using the skin:postprocess over the above?

Regards
Mark

1 Like

No real difference, the tag just calls the lib :smile:

1 Like

Cool - thanks Justin. Just wanted to make sure there wasn’t some difference to object broker caching etc.

Pro - it can be convenient (and a little more compact) to have the
postprocessing setting in a comment at the top.
Con - if there’s a lot of output in the webskin, doing the regex checks on
the entire output instead of just the stObj can have a performance impact.

Blair

Thanks Blair. Using the @@postprocessing comment at the top is what I would normally use but just in this case I couldn’t get it to work when calling fapi.getConfig etc.