CommonSpot ADF’s renderScriptOnce method

A tiny green sprout with a single leaf pokes up out of an otherwise dead houseplant.

A problem common across many CMS platforms is managing the loading of third-party JavaScripts, such as JWPlayer. You could make them available for any page in your website by including them in a global header or footer, but that approach is lazy and wastes bandwidth. A better approach is to include third-party JavaScripts on only the pages where they will be used.

For example, pages with embedded videos get the JWPlayer linking, but the pages lacking videos do not. This is fairly straightforward– just include the third-party JavaScript in the output of the plugin, render handler, etc. with which it is associated (i.e. your video element/plugin links to the JWPlayer script).

But what if a page has multiple instances of that video element/plugin?

Continue reading “CommonSpot ADF’s renderScriptOnce method”

Don’t Put “formID” In Your Custom Elements (It’s Already In There)

There can be only one . . . formID.

I wanted to share an odd puzzle I ran into recently with the Comments2 element in CommonSpot’s Blog2 application, on the off chance it might help someone else.

I was writing a custom script to help identify duplicated blog comments, but couldn’t get the ADF’s getCEData function to successfully retrieve the data.

It kept telling me:

Error in custom script module.

The column name (formID) that you specified already exists in this query.

Column names must be unique.

I won’t waste your time or patience by sharing everything I tried that did NOT work.

Continue reading “Don’t Put “formID” In Your Custom Elements (It’s Already In There)”