Reference

Reference

Constructor (Fliplet.Helper)

Defines a new Helper for the current screen. Use the constructor in Global JS code to define it for the entire app.

- public static object Fliplet.Helper(options: Object)

Fliplet.Helper({
 name: String,
 displayName: String,
 icon: String,
 data: Object,
 render: {
   template: String,
   beforeReady: Function,
   ready: Function
 },
 configuration: Object,
 views: Object,
 childOf: Array
});

Parameters:

Name Type Attribute Description
name string required A unique name for your helper.
displayName string optional The display name of the helper to show in the components list of Fliplet Studio.
icon string optional The icon of the helper to show in the components list of Fliplet Studio. You can use any Fontawesome name (e.g. `fa-check`) or URL.
data object or function optional The data for your helper.
render.template string optional An optional HTML template.
render.beforeReady function optional A function to run before the helper instance is rendered.
render.ready function optional A function to run when the helper instance is rendered.
configuration object optional The list of fields to present in the configuration UI.
views object optional The list of rich content views.
childOf array optional The list of helpers an helper can be dropped in.

Instance properties

Fliplet.Helper({
  name: String,
  render: {
    ready: function () {
      var instance = this;
    }
  }
});

Parameters:

Name Type Description
instance.set function Update the helper instance fields.
instance.find function Find nested helpers.
instance.findOne function Find a nested helper.
instance.children function Find direct child helpers.
instance.$el jQuery object The jQuery object containing the helper instance as element.
instance.parent object A reference to the parent helper instance if the current instance is nested (e.g. it's a children element of a parent helper).