Webanizr Logo
Open / sluit menu
Module multiStep

Last change: November 11, 2019

Current version: 1.4.1

The multiStep module facitates the checks and datastorage for activities in a website that span a multiple steps.

syntax

webanizr.collect('multiStep', parameters, callack);
webanizr.send('multiStep', data, parameters, callack);

collect

parameters

The multiStep module accepts the following parameters:

id__multistep (required)

The id assigned to the multistep. The id should only contain letters and numbers. The id is used to target the multistep in following actions.

configuration__steps (required)

The configuration of the entire proces. It consists of an array containing all possible steps. Each step contains the following information:

conditions__step

A list of the conditions that have to be met to activate this step. The conditions can have the following forms:

  • path path: true if the path matches the current path of the multiStep
  • steps:name__var == value: true if the given variable from the multiStep matches the given value

actions__init and actions__finish

Actions that should be performed. The actions from actions__init are excecuted as soon as the step is matched. The actions from actions__finish are excecuted once the step is marked as finished.

  • webanizrvar name__var value: set a value in webanizr to the given value

  • addtopath path: add the given string to the path

  • storedata: store the given in the multiStep

  • loaddataglobal: load the data from the multiStep and set them as web anizr values

  • topage url: navigate to the given url

  • onapisuccess url method: call the api and store the returned data in the multiStep

  • inform message: show the message using inform

  • ensureurl url: navigate to the given url if that is not the current url

callback

The callback is called after the step is matched and the initial steps are performed.

send

data

The data to be used by the actions.

parameters

id__multistep (required)

The id of the multiStep. This must be a multiStep that is created with the collect method.

type__action (required)

The action that sphould be performed. The following options are supported:

  • init: initialize the multistep (set the path to /)

  • finishstep: finish the active step

  • storedata: store the data in this mulitStep

  • setpath: set the path to the value from path__multistep in parameters

  • back: go one step back in the path. Skip steps that start with .

  • reset: reset the multistep (clear data and perform the init action)

  • setdatasection: creates a new datastore with this name. The data is only accassible on other pages if this datasecion is set again.

path__multistep (required foro the setpath action)

The path to replace the current path.

demo

https://cdn.cpmodules.webanizr.com/demo/multistep/index.html

Changelog

  • November 11, 2019: 1.4.1 - ensure url is no longere executed in Webanizr front-end mode
  • September 20, 2019: 1.3.0 - switched from local storage to session storage for storing of the steps data
  • September 16, 2019: 1.1.0 - switched from cookies to local storage for storing of the steps data
  • August 29, 2019: 1.2.0 - added setdatasection as an send action
  • August 28, 2019: 1.1.0 - added storeData as an send action