Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Attachments currently are not able to be added to Embed displays. It seems like this should be allowed.
Use case
From #10
It's been a while, haha, but I think the use case was needing to embed a view on a landing page content type using a field to select the View / Display. The embed display used an offset to exclude the first item, and an attachment was used to prefix the view with the first item in a different, more pronounced, style.
Comment | File | Size | Author |
---|---|---|---|
#8 | 2886613-attachments-on-embed-display-8.patch | 594 bytes | blake.thompson |
#3 | 2886613-attachments-on-embed-display-3.patch | 561 bytes | blake.thompson |
Comments
Comment #2
blake.thompson CreditAttribution: blake.thompson at Forum One commentedComment #3
blake.thompson CreditAttribution: blake.thompson at Forum One commentedAttached patch that allows attachments to be added to Embed displays.
Comment #4
dawehnerThat totally makes sense. @blake.thompson Do you think it makes sense to add a test here?
Comment #5
blake.thompson CreditAttribution: blake.thompson at Forum One commentedI don't think this particular change needs a test, it's just making use of the DisplayPluginBase boolean like Block and Page. If there should be more tests around the variable or method that uses it, then perhaps a test(s) should be added.
Comment #8
blake.thompson CreditAttribution: blake.thompson at Slalom commentedUpdating patch with {@inheritdoc}
Comment #9
dawehnerI don't see a reason not to support it. To be honest this is more of a task than a feature :)
One thing which would be nice, as it helps the committers: Name a concrete usecase you need this for.
Comment #10
blake.thompson CreditAttribution: blake.thompson at Slalom commentedIt's been a while, haha, but I think the use case was needing to embed a view on a landing page content type using a field to select the View / Display. The embed display used an offset to exclude the first item, and an attachment was used to prefix the view with the first item in a different, more pronounced, style.
Comment #11
dawehnerThank you @blake.thompson, I copied your statement into the issue summary.
I don't think we need tests given that we have this boolean flag tested in all the attachment tests already.
Comment #12
alexpottThis seems sensible. I tried it out and looked through the code for anything that might break. Couldn't spot anything. I contemplated whether or not this needs a change record and I don't think so.
Committed 5550b76 and pushed to 8.6.x. Thanks!
Comment #15
jastraat CreditAttribution: jastraat commentedHas anyone actually tested this? While attachments can now be linked to an embed display, if you try to display a summary in the attachment (as though you were going to create a glossary-like view+attachment) - it fails silently with no view results.