Skip to content
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

Write something about Preview in the Site Editor vs content / template editor #22

Open
bobbingwide opened this issue May 4, 2021 · 1 comment
Assignees
Labels
feechur It doesn't appear right. Who needs to know?

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented May 4, 2021

From Carolina's comment WordPress/gutenberg#29398 (comment)

It’s confusing that the Preview option is still not a real preview...

I was just creating a custom template for a page. After saving the page I viewed the site and realised that what I was looking at was nothing like what I saw in the the Preview.

Note: This was the Preview in the normal block editor.

image

Viewing the page in the front end the custom template is used.
Here I've used the inspector to preview display on an iPad.

image
image

In order to see the Preview using the correct template for the page I needed to:

  1. Open Site Editor
  2. Choose Toggle Navigation
  3. Choose Page Templates
  4. Choose Page Template hierarchy
  5. Choose Navigation again
  6. Choose Templates
  7. Choose Theme
  8. Choose Pages
  9. Search for the page
  10. Choose Template Hierarchy
  11. Toggle settings off
  12. Then choose Preview

And the results are subtly different from the actual front end.

image
image

@bobbingwide bobbingwide self-assigned this May 5, 2021
@bobbingwide bobbingwide added the feechur It doesn't appear right. Who needs to know? label May 5, 2021
@bobbingwide
Copy link
Owner Author

bobbingwide commented May 5, 2021

I also noted that my custom HTML block looked a bit better if it was also switched into Preview mode.
I found this had already been suggested. See WordPress/gutenberg#23328

The subtle differences were:

  • Unwanted padding and margins.

Part of the difference between the Preview and View is that the site's style.css is not loaded in Preview.
Perhaps this can be improved by using editor styles.

  • Navigation blocks are different
  • Shortcodes are not expanded

The 12 step process was quite a faff. It's much easier to save and view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feechur It doesn't appear right. Who needs to know?
Projects
None yet
Development

No branches or pull requests

1 participant