oskarrough / ember-wordpress

The bridge between Ember.js and Wordpress
http://ember-wordpress.surge.sh
MIT License
95 stars 26 forks source link

Question: How to preview posts #43

Open robwebdev opened 6 years ago

robwebdev commented 6 years ago

Not an issue, rather I was wondering how others are handling previewing of posts whilst using this addon, or just the WP Rest API in general.

The problem I foresee is that we will have a site built in Ember that consumes the WP content via the API, but clicking on the preview button in the WP admin will take the user to an unstyled template served by WP. Are there any ways around this?

oskarrough commented 6 years ago

You could add some basic styling to the Wordpress theme. Just enough for the preview to render ok.

Alternatively, to get drafts via the API I believe you'd have to authenticate first. Then you could your preview route in Ember and hack Wordpress to use that URL for previews.

I'd also be interested in anyone have a good solution for this. Because the above is not really great.

sheriffderek commented 6 years ago

I just trim up the WP admin so that options like 'preview' are just not there. We can only expect so much as far as integration - unless you want to make a WP plugin that would adjust that 'view-post' button to open your live client based on slug etc. In my case, I'm just trying to get a free CMS. Setting up all the ACFs and things in a WP theme for preview is more than I want to maintain. I am however working out a way for my article styles to be built by ember-cli - and sent to the WP install to show the copy in site-styles.

The bigger question for me is how to have a staging / or unpublished area to view things before the whole world can. Our writers want to see their words on the page and to review them in context before they are live. I could have a preview route or something that populates anything that isn't 'published' I guess...