- Issue created by @pinesso
Block ID rendered incorrectly when added via Layout Builder in IXM Blocks module
When creating a block through the block interface and adding it manually via the Layout Builder,
the block's ID is rendered incorrectly. For example:
<div id="statistics-"></div>
This happens because, for some reason, the block does not have a revision_id
when it's not added inline.
However, if added inline, the issue does not occur.
<div id="statistics-"></div>
The block ID should be properly populated based on the available revision_id
or fallback to a more consistent identifier.
Check if the revision_id
exists; if not, use the block’s id
instead. Here's a suggestion for how this could be handled in the template:
{% set block_id = 'statistics-' ~ configuration['block_revision_id'] ?? configuration['id']|split(':')[1] %}
...
{% block content %} <div id="{{ block_id }}">
This way, even when the block doesn't have a revision_id
, it will fallback to a valid identifier.
Needs work
1.0
Code