- Issue created by @jwilson3
When placing a SVG Media field block or SVG Image Field block into a Layout on a content type with Layout builder enabled, the preview contains a dynamically generated text file, which cannot be properly rendered in an <img>
tag, and therefore appears broken.
SVG Media Field block in LB:
<div class="block__content">
<div class="field field--name-field-media field--type-entity-reference field--label-hidden field__item">
<div class="media media--type-vector-image media--unpublished media--view-mode-default">
<div class="field field--name-field-media-svg field--type-svg-image-field field--label-hidden field__item">
<img width="400" height="400" alt="" src="/sites/default/files/2023-10/o7JMWdo1Hg.txt" draggable="false" />
</div>
</div>
</div>
</div>
SVG Image Field block in LB:
<div class="block__content">
<div class="field field--name-field-svg-image field--type-svg-image-field field--label-above">
<div class="field__label">SVG Image</div>
<div class="field__item">
<img width="25" height="25" alt="" src="/sites/default/files/2023-10/wBMDPu8DvX.txt">
</div>
</div>
</div>
Generate a placeholder SVG and use it instead of the auto-generated plain text file.
We may even be able to reference one of the text SVGs that comes packaged with the module, eg valid_svg--with-xml-doctype.svg
Placeholder images in Layout builder blocks for SVG Image Fields will display a working SVG image in the browser.
N/a
N/a
Active
2.3
Code