The KPI Dashboard – Evolved
1-877-233-6149
Contact Us

Make your Klip backwards compatible

Problem:

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.

Solution:

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:

  • 5893 or higher == KlipFolio version 4 or higher
  • 5884-5892 == KlipFolio version 3 or 3.1
  • 5883 or lower == KlipFolio verison 2.6 or lower

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.

Leave a Comment

To leave a comment, you must sign in or register (it's free).

   
Comment Type:
Title:
Comment: