- Merge request !9Issue #2825602 by segovia94, Eduardo Morales Alberti, Rob230, hawkeye.twolf,... β (Merged) created by mark_fullmer
- πΊπΈUnited States mark_fullmer Tucson
For folks using the patch from β¨ CKEditor 5 Support Fixed , here is a patch that can be applied alongside that one. This will not apply directly to the 2.x branch on its own.
- πΊπΈUnited States astringer
I tested #46 with the CkEditor 5 patch and it works well, thank you.
- π¬π§United Kingdom 2dareis2do
segovia94
@2dareis2do The inline padding is what allows the iframe to be responsive by setting it to a ratio of the width. This keeps the aspect ratio of the embed consistent no matter the screen size. See https://blog.theodo.com/2018/01/responsive-iframes-css-trick/ for the css trick used to accomplish this.
Totally agree with the technique. If i remember correctly there are similar alternative techniques for getting the aspect ratio correct. My point is that css should be in the css, not inline, in order to be responsive.
- last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - πΊπΈUnited States jjpost
Last diff didn't include all files. Attached another attempt.
- last update
over 1 year ago 5 pass - πͺπΈSpain guardiola86
Here's a patch updated for 1.x, I've replaced deprecated function drupal_get_path
- last update
over 1 year ago Patch Failed to Apply - πΊπΈUnited States jjpost
Last diff didn't include the libraries yml file...
- last update
over 1 year ago Patch Failed to Apply - πΊπΈUnited States jjpost
Sorry for the many retries. I haven't done this in a while. This patch should work against the 2.x-dev version
- last update
over 1 year ago Patch Failed to Apply - πΊπΈUnited States jjpost
Sorry for the many retries. I haven't done this in a while. This patch should work against the 2.x-dev version
- Status changed to Needs work
11 months ago 10:19am 4 January 2024 - π¨πSwitzerland berdir Switzerland
This needs to be updated for the committed ckeditor5 integration I guess.
FWIW, AFAIK modern css allows for a different and better way to define that.
How does core handle that? do we really need to ship the CSS for that ourself or is there something from core that we can use?
- πΊπΈUnited States mark_fullmer Tucson
How does core handle that? do we really need to ship the CSS for that ourself or is there something from core that we can use?
As far as I'm aware, this is still in-progress in core. The relevant issue is π Some oEmbed videos do not maintain aspect ratio Needs work , where the CSS approach proposed for url_embed matches that proposed 3 years ago ( https://www.drupal.org/project/drupal/issues/3060968#comment-13959443 π Some oEmbed videos do not maintain aspect ratio Needs work ), and that appeared to be the direction core was going to go, per https://www.drupal.org/project/drupal/issues/3060968#comment-14588388 π Some oEmbed videos do not maintain aspect ratio Needs work .
However, more recently, there is a proposal in https://www.drupal.org/project/drupal/issues/3060968#comment-14968763 π Some oEmbed videos do not maintain aspect ratio Needs work to make use of the aspect-ratio property, which as this point is well-supported by browsers: https://caniuse.com/mdn-css_properties_aspect-ratio
So we should probably explore that option before committing to the previous approach.
- πΊπΈUnited States ricksta
This patch should work against the 2.x-dev version. I've tested with url_embed 2.0.0-alpha2 release.
- πΊπΈUnited States ricksta
Sorry, that last patch won't do anything for making this module work responsively. But this patch should. I've tested with url_embed 2.0.0-alpha2 release.
- πΊπΈUnited States ricksta
This patch contains the new files. I've tested with url_embed 2.0.0-alpha2 release.
- πͺπΈSpain interdruper
#59 does not apply over 2.0.0-alpha2 release.
#58 applies, but it crashes because file /templates/responsive-embed.html.twig from #59 is not included in the patch #58. - Status changed to Active
10 months ago 9:00pm 18 January 2024 - πΊπΈUnited States mark_fullmer Tucson
Agreed that there are problems with both patches in #58 and #59. The attached patch will cleanly apply to 2.0.0-alpha2. Since there are subsequent changes in the 2.x branch that require adjustment, I'll update the merge request to be up-to-date with 2.x, as well.
Note that this patch does not provide a newer methodology as proposed in https://www.drupal.org/project/url_embed/issues/2825602#comment-15383198 β¨ Add option to make embeds responsive Needs work . This patch is intended to provide a solution for people trying to update to 2.0.0-alpha2 immediately.
- Status changed to Needs work
10 months ago 3:52pm 25 January 2024 - πΊπΈUnited States mark_fullmer Tucson
Setting to "Needs work," the goal being to update the existing (working) merge request to use a more modern CSS technique, as suggested in Comment #55 and elaborated on in Comment #56.
- πΊπΈUnited States mark_fullmer Tucson
As I think about this further, I think this responsive embed option should be enabled by default for new integrations.
This is the exception to the rule for new configuration options, of course, but in this case it makes sense: I believe that responsive display is going to be desired in the majority of cases, and opting out of that behavior the minority (as in the case where a site has customized the display further).
Another reason that I think it should be enabled by default is that the configuration option will be in one of those places in the Drupal interface that no one thinks to look: in a vertical tab as a setting under enabled text format filters. When working with my colleague recently on this, he "couldn't get responsive embeds" to work multiple times because he didn't notice the setting. We can and should and will document this, but we all know how many people read the manual...
I'll update the MR along these lines, but open to contrary opinions!
- πΊπΈUnited States ricksta
Testing the change in the merge request, I find that I can't see an embedded Soundcloud file, either in the CKEditor window or on the page. The wrapping element around the
<iframe>
needs to have some value for "padding-bottom," but instead has a NULL value, so the display appears invisible. - Status changed to Needs review
8 months ago 10:27pm 2 April 2024 - πΊπΈUnited States mark_fullmer Tucson
I find that I can't see an embedded Soundcloud file, either in the CKEditor window or on the page
Thanks for reporting this! Commit https://git.drupalcode.org/project/url_embed/-/merge_requests/9/diffs?co... handles this scenario.
- πΊπΈUnited States segovia94
I would recommend moving the responsive css away from the previous "padding" hack to the widely supported aspect-ratio property. I'm happy to update the code to use it unless there is some legacy reason not to. The previous padding hack can create problems due to its use of absolute positioning.
- πΊπΈUnited States mark_fullmer Tucson
I would recommend moving the responsive css away from the previous "padding" hack to the widely supported aspect-ratio property. I'm happy to update the code to use it unless there is some legacy reason not to.
I think that comports with the feeling in the comment thread above, e.g., https://www.drupal.org/project/url_embed/issues/2825602#comment-15385474 β¨ Add option to make embeds responsive Needs work
Yes, please feel free to push that code change to the merge request! There is no legacy reason to preserve the padding hack, in my opinion, since this has not been merged into the module yet.
Thanks!
- Status changed to Fixed
3 months ago 6:53pm 16 August 2024 -
mark_fullmer β
committed 23867166 on 3.x
Issue #2825602 by mark_fullmer, jjpost, segovia94, ricksta, Eduardo...
-
mark_fullmer β
committed 23867166 on 3.x
- πΊπΈUnited States mark_fullmer Tucson
Thanks, @segovia, for the more modern approach to the responsive embed in https://git.drupalcode.org/project/url_embed/-/merge_requests/9/diffs?co... !
With a few adjustments, tests pass. This is good to add to the 3.x branch, with the understanding that it is designed as an opt-in feature, so it will not negatively affect sites already using this module.
Automatically closed - issue fixed for 2 weeks with no activity.