Open Tim-Wils opened 5 years ago
Outputting the field in twig breaks the Live Preview functionality and gives an error. The problem is that the field needs to be json_encoded in the Live Preview.
To workaround this problem, this is a fix on the twig-side:
{% if craft.app.request.isLivePreview %} {{ myDynamicField|json_encode}} {% else %} {{ myDynamicField }} {% endif %}
Outputting the field in twig breaks the Live Preview functionality and gives an error. The problem is that the field needs to be json_encoded in the Live Preview.
To workaround this problem, this is a fix on the twig-side:
{% if craft.app.request.isLivePreview %} {{ myDynamicField|json_encode}} {% else %} {{ myDynamicField }} {% endif %}