Problem/Motivation
When paragraph template has the id attribute defined and not only containing the number, eg. 'paragraph--ID', layout paragraphs builder control will not appear. Because it is depending on the id attribute to attach control, which is looking for 'ID' alone.
Steps to reproduce
Add paragraph.html.twig, customize to have a paragraph ID.
...
{% set paragraph_id = 'paragraph--' ~ paragraph.id.value %}
<div{{ attributes.addClass(classes).setAttribute('id', paragraph_id) }}>
...
</div>
Proposed resolution
Use the "data-id" attribute.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | layout_paragraphs-3317406-use_data_attr-6.patch | 3.68 KB | ckng |
Issue fork layout_paragraphs-3317406
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
ckngComment #4
ckngComment #6
ckngAdditional changes in the LayoutParagraphsBuilder.php needed.
Comment #12
justin2pin commented