Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Every type has a name - for this article we use ‘customtype’.

  1. A JS question type object in [customization_assets_folder]/javascript/custom_questions.jsA view class and template in [customization_folder]/views/question_customtype/view.html.php and [customization_folder]/views/question_customtype/tmpl/default.php

  2. CSS styling in [customization_assets_folder]/css/custom.css

...

  1. A JS question type object

...

  1. in [customization_assets_folder]/javascript/custom_questions.js

View Class and Template

The class and template is responsible for adding the HTML of any question of this type to the configurator page. Question data and the current selection of the user is available to the template by default. See View class and template, 3) CSS Styling for details.

CSS styling

While there is common styling for questions, you can add additional styling in the custom CSS file. See the details in CSS Styling.

JS Question Type Object

While the user interacts on a configurator page, the CB framework triggers events that each question type reacts on (e.g. changes to the current user selection, activation or deactivation of a question, displaying a validation message etc). To make your question type react, you create a JS Question Type Object that contains callback functions for these events and register it. See the full details in JS question type object.