Hooks
Hooks are plugin interfaces for talking between a deck and the LivePreso application.
At present, there are four types which are listed below (Fieldsets, Selections, Selection Rules and Markers).
To add hooks to a deck, the hooks
key should point to a hooks
interface file in the project file.
This generally looks like:
hooks: js/hooks.js
This file exports an object of hook interfaces. The names are important, and must match like the example below.
import Fieldsets from "./hooks/fieldsets.js";
import SelectionRules from "./hooks/selection-rules.js";
import Selections from "./hooks/selections.js";
import Markers from "./hooks/markers.js";
export default {
fieldsets: Fieldsets,
selectionRules: SelectionRules,
selections: Selections,
markers: Markers,
};
In this example we have defined three relative files that export an interface of different types. This file is checked by the LivePreso and CDK apps to determine what hooks are available from your deck. Each hook is entirely optional.
fieldsets
Dynamically adds inputs to preso creation. This extra data can be used to modify the presentations in many different ways.
selections
Runs after preso save. Can be used to change sequence and visibility of slides and sections. Often this can be based on a selection from fieldsets. Additionally, subslides can be dynamically added during this process.
selectionRules
Similar to selections, selection rules run when sorting and changing visibility of slides in a preso's slide sorter, and is also used to change sequence and visibility.
markers
Runs after preso save and on context change. This can be used to set slides which need to be reviewed before the presentation can be started.