One moment, we're cooking some code examples
Add custom options or flags to make each slide unique
Re-using slides is great, but sometimes there are subtle differences across pages. Defining another slide for a simple configuration difference is not that great for performance and usability. That's why TypeStack introduced slide options! Slide options are flags or options you can define to give your slides dynamic options. You can, for instance, have one header slide with a dynamic option for a backgroud image. So that every slide can be configured to have a different backround image. Just think of any option or flag, such as displaying, heights, images, colours, anyting that can be put in a key-value pair.
Adding slide options is easy. Just navigate to "templates", edit an eixsting template (or create a new one), edit the slide you want to add the slie option to, navigate to the tab "content" and add your slide option. Choose a content type (text, image, etc), the title for your option, (optionally) a description for your option, if the option is required or not and add it to your slide!
Slide options are added via the database instead, Slide options can be listed via the dashboard
Adding a slide option:
Add a row to cms_template_slide_options, insert your slide_id, the content type (1 = input, 2 = image), the option_title, option_description, option_content_required, option_date_added and option_status and add row.
The example below provides a dynamic slide option values for the height of a header Element
Once your slide option is configured, simply read, validate and format them inside your code: