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

Suggestion: Modify page Preview button to render full page in a new tab with unsaved content #689

Closed
a1studmuffin opened this issue Jul 9, 2016 · 2 comments
Assignees

Comments

@a1studmuffin
Copy link

Currently if you edit a page, then press the Preview eye button at the very top of the admin page before saving, you get the warning:

"Changes Detected
You have unsaved changes. Are you sure you want to leave without saving?"

It would be cool if Grav was smart enough to realise I was trying to preview the unsaved changes, and spawned a new tab with a full rendered preview of the unsaved changes using the appropriate template.

I'm aware there's already the content preview button, but that only renders the markdown content section. Part of Grav's appeal is that you can use the yaml frontmatter on a page to add additional visible content via templates, but you can only see this when the page is fully rendered. As it stands there's no way to preview those yaml frontmatter changes without saving the page then browsing to the URL. Not a big deal when you're building the site, but if you're a content creator with a live site, I think you probably want a way to check this before saving.

You may already have something different planned that addresses this issue, just thought it was worth raising.

Cheers,
Michael

@w00fz w00fz self-assigned this Jul 9, 2016
@w00fz w00fz closed this as completed in 39cffad Jul 9, 2016
@w00fz
Copy link
Member

w00fz commented Jul 9, 2016

Done 👍
Note, this is only for the clicking away and opening an external tab. It's really not possible to open a Preview without having saved the data, the Preview button you click is really just a shortcut to the actual page on the frontend which depends on stored, up-to-date data.

@a1studmuffin
Copy link
Author

a1studmuffin commented Jul 9, 2016

Oh my good lord, you guys are insane. :D So that simple change will cause the preview button to show the unsaved changes to the page, including the frontmatter?

Edit: Just re-read your message, sorry ignore that last comment. So sounds like the original behaviour I mentioned is probably going to be a bit of work - is it worth reopening a separate issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants