verbb / vizy

A flexible visual editor for Craft CMS
Other
44 stars 8 forks source link

Images not rendering using renderHtml #91

Closed d-karstens closed 2 years ago

d-karstens commented 2 years ago

Description If a Vizy field only contains images nothing renders when using vizyField.renderHtml(), unless the field also contains some text

We're currently working around this using

{% for node in entry.copy.all() %}
  {% if node.type == 'image' %}
    <img src="{{ node.attrs.src }}" alt="{{ node.attrs.alt }}"/>
  {% else %}
    {{ node.renderHtml() }}
  {% endif %}
{% endfor %}

Steps to reproduce

  1. Create a Vizy field with nothing but an image in it
  2. Nothing displays when using {{ vizyField.renderHtml() }}

Additional info

Additional context

engram-design commented 2 years ago

Should be fixed for the next release. To get the fix early, change your verbb/vizy requirement in composer.json to:

"require": {
  "verbb/vizy": "dev-craft-3 as 1.0.8",
  "...": "..."
}

Then run composer update.

d-karstens commented 2 years ago

Thank you, much appreciated!

engram-design commented 2 years ago

Fixed in 1.0.9