-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve handling of WordPress post embeds #809
Comments
Things have regressed in the current version of the plugin. The iframe is not showing up at all now. Given
Normal WordPress RenderingThe normal WordPress rendering looks like: With the underlying HTML being: <blockquote class="wp-embedded-content" data-secret="swkquRFsjz">
<p><a href="https://make.xwp.co/2018/09/24/amp-plugin-release-v1-0-beta4/">AMP Plugin Release v1.0-beta4</a></p>
</blockquote>
<p>
<iframe
class="wp-embedded-content"
sandbox="allow-scripts"
security="restricted"
style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"
src="https://make.xwp.co/2018/09/24/amp-plugin-release-v1-0-beta4/embed/#?secret=swkquRFsjz"
data-secret="swkquRFsjz"
width="600"
height="338"
title="“AMP Plugin Release v1.0-beta4” — Make XWP"
frameborder="0"
marginwidth="0"
marginheight="0"
scrolling="no">
</iframe>
</p> The iframe AMP Plugin RenderingThe rendered AMP response looks like this: There is actually still an <blockquote class="wp-embedded-content" data-secret="swkquRFsjz">
<p><a href="https://make.xwp.co/2018/09/24/amp-plugin-release-v1-0-beta4/">AMP Plugin Release v1.0-beta4</a></p>
</blockquote>
<amp-iframe
class="wp-embedded-content amp-wp-enforced-sizes amp-wp-5e9b0a2"
sandbox="allow-scripts"
src="https://make.xwp.co/2018/09/24/amp-plugin-release-v1-0-beta4/embed/#?secret=swkquRFsjz"
data-secret="swkquRFsjz"
width="600"
height="338"
title="“AMP Plugin Release v1.0-beta4” — Make XWP"
frameborder="0"
scrolling="no"
layout="intrinsic"
>
<div placeholder="" class="amp-wp-iframe-placeholder"></div>
</amp-iframe> But it is now showing up because of this CSS: .amp-wp-5e9b0a2{position:absolute;clip:rect(1px,1px,1px,1px)} This is coming from core, as JS in core is supposed to give the iframe the right dimensions when they are received after removing the above style. Resizing
|
Proposal to implement AMP component for embedding WordPress posts: ampproject/amphtml#18378 |
Correction: We don't have to use Shadow DOM. The component can create an |
There's a lot of tickets about WP embeds in AMP, but it seems like this one is the "parent" that's still open. Just want to confirm current status as a user: This work is still ongoing, and for now WP embeds in AMP simply don't work, and will show as the basic blockquote. If so that's fine. Luckily the WP embed has a great fallback format (unlike FB and most of the others). Looking forward to the day when all this work you're doing pays off :) |
@jerclarke That's correct. The ultimate resolution for this issue is to introduce a new Once that is available, we can finalize #3465 which will close this issue. I don't have a good timetable on when we'll get to this. Perhaps April? |
Awesome. Safe pitch to my org to keep using the embeds and be patient for an AMP-native solution in the near future 🙏🏻 |
This is no longer blocked! The See example in AMP Playground. Work can proceed once #6436 is merged or by basing off of that branch. |
The PR has been merged into |
Punting since the bento experiment is still required: https://tundra-functional-double.glitch.me/ |
QA Passed ✅ The Post Embeds looks fine. Before: Posts embeds were not rendering properly After: Posts embeds are rendering properly But one observation here: As per comment the expand button persist or instead the element should increase it's height as soon as it receives the message from the origin. But seems like it's expected behavior. |
If the embed is in the (initial) viewport when it loads, then it's expected that it would not resize since this would cause a layout shift. |
The handling of post embeds isn't great in AMP right now because the
p.wp-embedded-content
isn't getting replaced with theiframe.wp-embedded-content
like it does in the non-AMP version. The result is some doubling of content.Compare in a post I just published:
Canonical (non-AMP) version:
AMP version:
The text was updated successfully, but these errors were encountered: