Reference

Reference

Constructor (Fliplet.Helper())

Dependency: fliplet-helper

The Fliplet.Helper() constructor defines a new Helper for the current screen. Use the constructor in Global JS code to define it for the entire app.

Fliplet.Helper({
 name: String,
 displayName: String,
 icon: String,
 supportUrl: String,
 data: Object,
 supportsDynamicContext: Boolean,
 watch: Array,
 category: {
   name: String,
   before: String,
   after: String
 },
 position: {
   before: String,
   after: String
 },
 render: {
   template: String,
   beforeReady: Function,
   ready: Function,
   dependencies: Array
 },
 configuration: {
   title: String,
   fields: Array,
   beforeReady: Function,
   ready: Function,
   beforeSave: Function
 },
 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.
supportsDynamicContext Boolean optional Indicates that a component needs to complete certain tasks or operations before its children are initialized. When set to true, `Fliplet.Widget.initializeChildren()` will be called when the component is ready to start initializing its child components.
icon String optional The icon of the helper to show in the components list of Fliplet Studio. You can use any Font Awesome name (e.g. fa-check) or a URL.
category Object optional Use this to define which category the helper should be listed under
category.name String optional Specify the category where the helper should be listed under or provide a new category name
category.before String optional Specify the category that the new category should be listed before. Takes precedence over category.after.
category.after String optional Specify the category that the new category should be listed after
position Object optional Specify where in a category the helper should be positioned
position.before String optional Specify the name/package of widget or name of helper to position the helper before. Takes precedence over position.after.
position.after String optional Specify the name/package of widget or name of helper to position the helper after.
supportUrl String optional Support URL for the component. Users can access this via the configuration interface in a "?" icon.
watch Array optional The list of properties to add watchers for, when used in a dynamic container component. The most common value for this field is ['context'].
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.
render.dependencies Array optional A list of dependencies to include when rendering the helper.
configuration Object optional The list of fields to present in the configuration UI.
configuration.title String optional A title to display at the top of the configuration interface
configuration.fields Array required The list of fields to display in the UI.
configuration.beforeReady Function optional A function to run before the configuration interface gets initialized.
configuration.ready Function optional A function to run when the configuration interface gets initialized.
configuration.beforeSave Function optional A function to run before the configuration interface data is saved..
views Object optional The list of rich content views.
childOf Array optional The list of helpers an helper can be dropped in.

Helper instance

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

Instance properties

Name Type Description
instance.$el jQuery 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).

Instance methods

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.parents Function Find all parent helpers.
instance.closest Function Find closest helper.