Live preview doesn't currently work for SPAs or API-driven sites where you're not using Twig, but still have Craft-managed URLs.
It would be nice to be able to disable the Live Preview button all together.
...or even better, have a way to map it to the "real" URL for the site, so content authors can preview it.
...or even better, have a way to map it to the "real" URL for the site, so content authors can preview it.
In my case, the Craft URL _is_ the "real" url…(but the site's URL isn't pointing to the Craft Server, it points to a Node/Express server). But that page just makes calls to the craft server/api, it doesn't know how to response to live preview POST data like Craft Twig templates do.
Related: see comment from @narration-sd: https://github.com/craftcms/cms/issues/1521#issuecomment-409909748
Tim, my first thought was that if you're in a pinch, why not use @lindseydiloreto 's Control Panel CSS plugin to just disappear the button? It's alive; just apparently not on the store because it's free.
https://github.com/doublesecretagency/craft-cpcss
As far as upcoming solutions, I've been mulling whether you and one other at least ought to be getting some email soon. I have to limit the onslaught, and would have to tease about impatience-as-a-virtue ;), but beta on someone else's prototype website has been quite valuable, seeing how people are in realities likely to employ this thing.
We’ll most likely make this possible when we get around to #1489. In the meantime, you could just set your section’s Template setting to an invalid template path. The Live Preview button will only show up if the section has URLs _and_ the template exists. (A blank Template path is still valid if you have an index.twig file.)
Good tip, @brandonkelly!
That is a smart one :)
On Fri, Aug 10, 2018, 14:00 Tim Kelty notifications@github.com wrote:
Good tip, @brandonkelly https://github.com/brandonkelly!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/craftcms/cms/issues/3192#issuecomment-412205121, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAPIiURj0VD5dBzloxhtuPno0ATnAw7Mks5uPfSGgaJpZM4V4h5a
.
The Live Preview button will only show up if the section has URLs and the template exists.
@brandonkelly the bummer about that is it _also_ removed the "share" button, so there's no way to open the entry URL from entry edit.
For a quick fix, made this: https://github.com/craftcms/cms/pull/4275
You were one day too early @timkelty :) #1489 is resolved now as of Friday, so now there’s a way to share/preview entries (and other elements) whether or not Craft is the one rendering them.