Skip to content

isSveContext()

The isSveContext method is used to check whether the current module is being rendered from the SVE (Storefront Visual Editor) configurator context.

This is useful when you want to conditionally render different content or disable some behaviors during SVE preview.

Returned value

bool — returns true if the module is rendered within the SVE configurator, false otherwise.

Example

source
{% if ObjectApi.isSveContext() %}
    <p>Podgląd w edytorze wizualnym</p>
{% else %}
    <p>Normalne renderowanie sklepu</p>
{% endif %}
output
Normalne renderowanie sklepu