wintercms / wn-pages-plugin

Static Pages plugin for Winter CMS
https://wintercms.com/
MIT License
9 stars 22 forks source link

Support for live previews of Pages #19

Closed LukeTowers closed 1 year ago

LukeTowers commented 1 year ago

This PR adds initial support for a "Preview" tab that presents a live preview of the page currently being edited on the frontend without requiring the page or changes to be saved first.

Screen Shot 2022-09-25 at 4 16 42 PM

TODO:

der-On commented 1 year ago

I've created a plugin that allows just that:

LukeTowers commented 1 year ago

@der-On cool! Do you have a screenshot of what the UX looks like?

der-On commented 1 year ago

@der-On cool! Do you have a screenshot of what the UX looks like?

Sure:

Bildschirmfoto vom 2022-09-29 09-01-30 Bildschirmfoto vom 2022-09-29 09-07-04

The plugin also allows to add a preview to any model form with a single line of php code in the plugins register method. The model just needs to implement a preview() method.

jaxwilko commented 1 year ago

@LukeTowers, just pushed a commit to prevent the preview being displayed by default so that people have to "opt in" to using it, any thoughts?

Also I fixed some display issues.

Is there anything else that needs doing before this can be merged?

LukeTowers commented 1 year ago

@jaxwilko any reason why it should be opt-in instead of just always enabled?

jaxwilko commented 1 year ago

@LukeTowers not really, just thought it would make sense for people to opt in

LukeTowers commented 1 year ago

Meh, if it's opt in no one's going to see it. If you can think of a reason why someone would want it disabled then we could look at providing that as an option but at the moment I'm fine leaving it always enabled.

LukeTowers commented 1 year ago

@jaxwilko todo before we can merge:

jaxwilko commented 1 year ago

@jaxwilko todo before we can merge:

@LukeTowers all of there points have now been complete, tested everything and it all looks good, just need to add unit tests

jaxwilko commented 1 year ago

@LukeTowers tests now pass :)