Help Center
  • Welcome
  • Setka Editor
    • Getting started
    • Drag-and-Drop & Multiselect
    • Text editing
    • Grids and Layout
    • Images
      • Image Editor
    • Background images
    • Icons
    • Animations
    • Lists
    • Tables
    • Dividers
    • Footnotes
    • Hotspots
    • Enhance Symbols
    • Post templates
    • Buttons
    • Comments and collaboration
    • Embeds
    • Hyphenation
    • Responsive layout for mobile screens
    • Custom CSS
    • Custom JS plugins
  • Setka Content Design System Manager
    • Creating and editing styles
    • Text formats and fonts
    • Styles display for mobile mevices
    • Text and background colors
    • Dividers
    • Icons
    • Components – reusable design elements
      • Creating Components with HTML and CSS
        • CSS in components
        • Component examples
    • Configuring layout grids
    • Editing default elements with Custom CSS
    • Adding team members
  • Account Settings
    • Account settings basics
    • Access rights
    • Billing and subscription
  • Preserve your Setka Editor content after the service shutdown
  • Integrations
    • Setka and WordPress
      • Installing Setka Editor WordPress plugin
      • Launching Setka Editor on the post creation page
      • Setka Editor and WordPress compatibility
      • Setka Editor compatibility with the most popular WordPress plugins
      • Inserting graphs, charts, or diagrams into a post
      • Setka Editor and Google AMP
      • Inserting adverts into a post
      • srcset — the attribute for image size optimization
      • Page load speed optimization settings
        • Autoptimize plugin configuration
      • WordPress troubleshooting: known Issues and how to fix them
      • Preserve your Setka Editor content after the service shutdown
    • Setka and Drupal
      • Setka for Drupal — compatibility, and features
      • Installing Setka modules for Drupal
      • Setka content on AMP pages in Drupal
    • Setka and Magento
      • Installing Magento 2 extension
        • Setka Editor configuration page
      • Preserve your Setka Editor content after the service shutdown
    • Setka and HubSpot
      • Setka Editor and HubSpot Blogs
      • Setka Editor and HubSpot Landing Pages
      • Semi-gated content with a HubSpot form
      • Preserve your Setka Editor content after the service shutdown
    • Setka and Bitrix
      • Preserve your Setka Editor content after the service shutdown
    • Setka and Ghost
      • Copying and pasting posts from Setka to Ghost
    • Setka and SharePoint Online
      • Installing Setka Editor application into SharePoint Online
    • Setka and Zapier
      • Setka and Webflow
        • Exporting new posts
        • Updating exported posts
      • Setka and Shopify
    • Setka and Integromat
    • Content Cloud
  • API
    • Setka Content Cloud API
    • Webhooks
    • API for Custom CMS Integration
      • Introduction to custom integration
      • Integration with Content Design System Manager (CDSM)
        • Initial sync — receiving Setka Editor files to connect them to your CMS
        • Storing and processing Setka Editor files
        • Connecting Setka Editor files to the pages of your site
        • Receiving style updates from the Style Manager and new editor versions
      • Setka Post Editor initialization (JavaScript)
      • Integration with Style Manager (API v1, previous version)
      • Preserve your Setka Editor content after the service shutdown
    • Custom Components API
  • VIDEO TUTORIALS
    • Setka Editor Video Tutorials
  • Components Library
    • Components Library
    • Guide: Ideas for Using Setka Editor’s Components to Improve Content Design
  • Content Experience Design Best Practices
    • Guide To Designing a Great Content Experience
Powered by GitBook
On this page
  • What are custom JS plugins
  • How it works
  • Loading a JS plugin to your Setka post
  • Where the JS plugin can be stored?
  • Custom JS examples
  • stk/content-slider
  • stk/lightbox
  • stk/spoiler

Was this helpful?

  1. Setka Editor

Custom JS plugins

Supercharge your Setka posts with custom JS plugins. Implement your content sliders, image popups, accordions, tabs, and many more. Build JS plugins for your content any way you want.

PreviousCustom CSSNextSetka Content Design System Manager

Last updated 2 years ago

Was this helpful?

Setka Editor provides various interactive elements to diversify your content and make it more engaging. It includes animations, galleries, hotspots, and footnotes. And we are always happy to add more to the package.

We also understand that you might need to create experiences that are not yet available as Setka's default features. Therefore, we want to give you an option to create your own JavaScript plugins enabling you to implement new custom elements. For interactive examples, visit our .

What are custom JS plugins

Custom JS plugins allow you to build your JavaScript-based logic on top of the Setka Editor content. You can create custom plugins that add new interactive components: galleries, content sliders, animated pieces, checklists, anything you could think of.

Basically, any functionality that can be achieved by combining JavaScript and Setka-based HTML is possible.

How it works

  1. You build the JavaScript plugin.

  2. Load it to your server or send it to us to load on Setka CDN. The place to store your JS plugin is determined based on your integration type.

  3. The plugin is then loaded to the Setka content pages. These plugin manipulates the content based on your described logic. The processes of launching the plugin on the page and uploading it to Setka CDN (if needed) are described below:

Loading a JS plugin to your Setka post

The JS plugin can be connected to the page by adding the corresponding data-* attribute into an HTML tag, in a form of:

data-stk-plugin="[vendor_code]--[plugin_name]--[plugin@version_number]"

Where:

  • [vendor_code] is the vendor code for your plugin.

  • [plugin_name] is the plugin name.

  • [plugin_name@version] is the plugin version.

For example, adding the data-stk-plugin="stk--content-slider--content-slider@0.5" attribute will enable the stk/content-slider@v0.5 plugin.

The HTML code that loads the plugin within the grid will look like this:

<div class="stk-grid stk-stk-content-slider"
     data-ce-tag="grid"
     data-stk-plugin="stk--content-slider--content-slider@0.5">
...
</div>

Where the JS plugin can be stored?

There are several ways of storing the plugin depending on the Setka Editor integration type.

Custom integrations

Please create plugins with attention to code structure. Keep in mind, that plugins may interfere with the Setka Editor itself if built unsafely. Setka Support team would not be able to debug such modifications.

Default CMS integrations and Content Cloud

In the message, please:

  • Specify your company/account name.

  • Describe the functionality of the plugin.

  • Attach the JS file of the plugin.

We will verify the JS code of the plugin. If it complies with our requirements, it would be uploaded to your Setka account. Then you would be able to use it in your posts and components. We will reach out to you directly if any fixes or additional information is needed.

Custom JS examples

stk/content-slider

Content slider built of stk-grid components.

How to enable

Add data-stk-plugin="test-01--content-slider--content-slider@0.5" attribute to any HTML element of the post:

<div class="stk-grid stk-stk-content-slider stk-theme_44178__mb_4 stk-layout__overhangs_both" data-ce-tag="grid" data-stk-plugin="test-01--content-slider--content-slider@0.5" data-stk-css="stkc9gKg">
  <div data-col-width="12" class="stk-grid-col stk-grid-col_last stk-theme_44178__pad_ver_2" data-ce-tag="grid-col">
    <div class="stk-grid" data-ce-tag="grid">
      <div data-col-width="12" class="stk-grid-col stk-grid-col_last stk-theme_44178__pad_ver_4" data-stk-css="stkxSRMP" data-ce-tag="grid-col">
        <p class="align-center stk-reset stk-theme_44178__color_44178_custom_color_3" data-ce-tag="paragraph">Slide 1</p>
      </div>
    </div>
    <div class="stk-grid" data-ce-tag="grid">
      <div data-col-width="12" class="stk-grid-col stk-grid-col_last stk-theme_44178__pad_ver_4" data-stk-css="stkFNJ1Y" data-ce-tag="grid-col">
        <p class="align-center stk-reset stk-theme_44178__color_44178_custom_color_3" data-ce-tag="paragraph">Slide 2</p>
      </div>
    </div>
    <div class="stk-grid" data-ce-tag="grid">
      <div data-col-width="12" class="stk-grid-col stk-grid-col_last stk-theme_44178__pad_ver_4" data-stk-css="stkQce-E" data-ce-tag="grid-col">
        <p class="align-center stk-reset stk-theme_44178__color_44178_custom_color_3" data-ce-tag="paragraph">Slide 3</p>
      </div>
    </div>
  </div>
</div>

stk/lightbox

Simple image lightbox.

How to enable

Add data-stk-plugin="test-01--lightbox--lightbox@0.4" attribute to any HTML element of the post:

<div class="stk-theme_44178__mb_4 stk-grid" data-ce-tag="grid" data-stk-plugin="test-01--lightbox--lightbox@0.4">
  <div data-col-width="4" class="stk-grid-col" data-ce-tag="grid-col">
    <figure class="stk-reset stk-image-figure" data-ce-tag="image-figure">
      <div data-ce-tag="mask" class="stk-mask"><img src="https://via.placeholder.com/1280x768.png?text=Image+01" alt="Image 01" class="stk-image stk-reset" /></div>
    </figure>
  </div>
  <div data-col-width="4" class="stk-grid-col" data-ce-tag="grid-col">
    <figure class="stk-reset stk-image-figure" data-ce-tag="image-figure">
      <div data-ce-tag="mask" class="stk-mask"><img src="https://via.placeholder.com/1280x768.png?text=Image+02" alt="Image 02" class="stk-image stk-reset" /></div>
    </figure>
  </div>
  <div data-col-width="4" class="stk-grid-col stk-grid-col_last" data-ce-tag="grid-col">
    <figure class="stk-reset stk-image-figure" data-ce-tag="image-figure">
      <div data-ce-tag="mask" class="stk-mask"><img src="https://via.placeholder.com/1280x768.png?text=Image+03" alt="Image 03" class="stk-image stk-reset" /></div>
    </figure>
  </div>
</div>

stk/spoiler

Simple spoiler.

How to enable

Add data-stk-plugin="test-01--spoiler--spoiler@0.6" attribute to any HTML element of the post:

<div class="stk-theme_44178__mb_4 stk-grid" data-ce-tag="grid" data-stk-plugin="test-01--spoiler--spoiler@0.6">
  <div data-col-width="12" class="stk-grid-col stk-grid-col_last" data-ce-tag="grid-col"><button class="stk-theme_44178__stk-btn_basic stk-theme_44178__style_font_style-1593690481067 stk-reset" data-stk-button="1">Click me!</button>
    <div class="stk-grid" data-ce-tag="grid">
      <div data-col-width="7" class="stk-grid-col" data-ce-tag="grid-col">
        <p class="stk-reset" data-ce-tag="paragraph">Here is the hidden content.</p>
      </div>
      <div data-col-width="5" class="stk-grid-col stk-grid-col_last" data-ce-tag="grid-col">
        <figure class="stk-reset stk-image-figure" data-ce-tag="image-figure">
          <div data-ce-tag="mask" class="stk-mask"><img src="https://via.placeholder.com/1280x768.png?text=Image+01" alt="Image 01" class="stk-image stk-reset" /></div>
        </figure>
      </div>
    </div>
  </div>
</div>

The code that includes the plugin can be saved as a . This way your users would be able to quickly add custom interactive elements to the post.

If you are using a custom , you can upload the JS plugin on your own server where Setka Editor is running. This plugin should also be connected to article pages where the custom element is used.

To enable your custom JS plugin for one of the default CMS integrations and/or in the , please contact our support team at with the topic "Custom JS plugin application".

blog page about Custom JS plugins
component
Setka Editor integration via API
Content Cloud
support@tiny.cloud