-
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
How can I preview AMP pages in Gutenberg? #2934
Comments
I don't think we currently add an AMP Preview button in Gutenberg. But I suppose we should :-) |
Yeah, the classic editor has a preview button for AMP in Transitional and Reader modes (IIRC). We didn't add it to Gutenberg because... we probably didn't know how. |
Love the honesty. What about adding a text link below the Enable AMP toggle that says Preview AMP Post? It doesn't have to be next to the preview button. |
For comparison, here's the preview button in the classic editor: And here is the same section in the block editor: Since the preview button in the block editor could only be modified using direct DOM manipulation or perhaps by overriding So using the same I think that is a reasonably small enhancement to include in the next release. It might mean duplicating larges parts of the |
Right, that's my suggested location as well. Needs lots of the logic from This is currently in the backlog, so we will get to it at some point. |
If possible to integrate with the existing Preview button, that'd be great, otherwise having a separate AMP preview button makes sense. |
I think Option 2 is the nicest. The question is whether we can reliably decorate the existing Preview button here. |
Agreed - yes that would be optimal. |
I concur; as long as the effort is not a lot more. |
Hi @schlessera, Would you mind if I worked on this? |
@kienstra No, not at all. I saw you were already looking into it, so I skipped it and went to the first item in the back log already. |
OK, thanks! Have a great weekend! |
Update: please ignore these, as this has changed.Testing Steps
17: Expected: it should open a new tab for an AMP URL: |
I'll make a screencast for this when #3323 is approved, as there might be changes to the button or the preview |
Can this new preview button be used to enhance the existing one as in option 2 mentioned above? I thought that was the consensus. |
Option 2 Hi @swissspidy, But I couldn't find a way to do that, other than maybe manipulating the DOM. That PostPreviewButton doesn't look to be filterable, nor does the Header that uses it. |
Yes, DOM manipulation was mentioned earlier in this thread as the potentially only possible way to do this. @kienstra For the sake of testing, could you perhaps create a PR against your |
Hi @swissspidy, |
Steps To Test
|
Request For Testing Hi @csossi, |
Verified in QA |
In the classic editor, next to the preview button was an AMP icon which allowed a user to preview the AMP page. In Gutenberg this button doesn't show and there doesn't seem to be a way to preview AMP pages in Gutenberg.
Is there a button someplace that I just don't see? Or is it not available in Gutenberg?
I do know I can just add
&=1
to the preview URL, but that's not client friendly. They like buttons. :)The text was updated successfully, but these errors were encountered: