Skip to content

Property Values in JavaScript & Template Code#

Access via Template code#

All the values of the properties a user has entered via the Miva admin are available in the instance template using the following structure:


The l.settings:instance is a structure containing all the property values of the component. It uses the codes you give to each property. For Example lets say we want to access the value the customer input for the subheading property





Accessing via JavaScript#

The entire l.settings:instance structure can be output to a JSON object which can them be used in your javascript files for your component.

    var instance = <mvt:eval expr="miva_json_encode( l.settings:instance, '')" />;

    // instance.content.subheading.value

Sequence and Flex Item Variables#

The following variables are available in page templates, which grant access to the flex item, sequence item, sequence item position in its own sequence, and sequence item position in all output sequence item lists. These variables are helpful to output identifying information to the page for testing scripts, javascript tracking (google analytics impressions), A/B testing, etc

Sequence Index/Pos#


This is the current sequence-item position. It could be used to apply a counter


This is the sequence-item position accounting for all sequences rendered on page

Flex Item#


Helps identify components for various uses (e2e tests, tracking, future custom logic)

Sequence Item#


This info can be used for e2e, javascript tracking (google analytics impressions), A/B testing, etc.