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.

Command icon 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

ckng created an issue. See original summary.

ckng’s picture

Status: Active » Needs review
StatusFileSize
new21.49 KB

Status: Needs review » Needs work

The last submitted patch, 2: layout_paragraphs-3317406-use_data_attr-2.patch, failed testing. View results

ckng’s picture

Status: Needs work » Needs review
StatusFileSize
new1.31 KB

Status: Needs review » Needs work

The last submitted patch, 4: layout_paragraphs-3317406-use_data_attr-4.patch, failed testing. View results

ckng’s picture

Status: Needs work » Needs review
StatusFileSize
new3.68 KB

Additional changes in the LayoutParagraphsBuilder.php needed.

sethhill made their first commit to this issue’s fork.

sethhill changed the visibility of the branch 3265794-modal-actions-refactor to hidden.

justin2pin made their first commit to this issue’s fork.

justin2pin’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.