Start page / Plug-In Development / ContentCreator Extensions / Interactive Features / Template Buttons / Functional Overview
Template Button: Functional Overview
In order to add interactive features to template forms and preview output, project designers may use the input component FS_BUTTON. Buttons of this type can be styled in various ways and associated with code to handle click and drag-and-drop operations.
Functionality
The input component FS_BUTTON can be inserted into any form as well as any template output channel; specific to ContentCreator, output channels will most likely contain a variant of HTML.
The two available button styles always show a label text, and the button style “FIRSTSPIRIT” may optionally display an icon graphic stored as a resource in a FirstSpirit Module or in the project's Media Store. Alternatively, an FS_BUTTON may be styled as a simple text link.
Each instance of this component can handle click actions and act as a target for drag-and-drop operations sourced, for example, from snippets displayed in a . Each of these interactions can trigger a different script or call an executable Java class, provided either by ContentCreator or a plug-in.
Specific to FS_BUTTON instances visible in ContentCreator previews, FirstSpirit offers several Java executables that can be used to access advanced, context-sensitive ContentCreator functionality. These executable classes are documented on the page Functions in the preview.
Example Implementation
The ContentCreator Examples module source code includes one implementation of an FS_BUTTON executable class:
- TextBlocksDropHandlerExecutable
This example is located in the module's package de.espirit.firstspirit.opt.example.webedit.report, as it implements report-related functionality.
Code Example
The Template Button (FS_BUTTON) Code Example introduces and documents the implementation of click and drop handling using an executable class.