You've written a Klip that uses the features in a new version of KlipFolio, but you also want users who have a previous version of KlipFolio to be able run your Klip.
When you come to a point in your Klip's javascript where you want to support multiple versions of KlipFolio, check the value of KlipFolio.build. KlipFolio.build contains the build number of KlipFolio that the user is running. The following chart shows the relation between build number and KlipFolio version numbering:
One way to use this information is to provide two different style definitions for your Klip, one that uses the new frame capabilities of KlipFolio version 4, and one that uses the classic "image with text" display of KlipFolio version 3. Define two style definitions as strings:
var frameStyle = "item{type: item; layout: frame;}; "; frameStyle += "image{type: image; itemcol: 1; noterow: 1; fit: zoom;}; "; frameStyle += "title{type: text; noterow: 2; notelabel: false;}"; var classicStyle = "item{type: item;}; "; classicStyle += "image{type: image; itemcol: 1; noterow: 1; height: 3;}; "; classicStyle += "title{type: text; itemcol: 2; noterow: 2; notelabel: false;}";
Be sure to leave your <style> definition at the top of the Klip blank. Then, in your onLoad function include the following code:
if(KlipFolio.build >= 5893) { // KlipFolio version 4 detected Engines.KlipFood.stylesheet = frameStyle; } else { Engines.KlipFood.stylesheet = classicStyle; }
Another way to use this information is to simply display a message to your users that your Klip only works with a certain version of KlipFolio. See the Webcam Template Klip for an example of this.