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

Allow disabling of Live Preview #3192

Closed
timkelty opened this issue Aug 10, 2018 · 8 comments
Closed

Allow disabling of Live Preview #3192

timkelty opened this issue Aug 10, 2018 · 8 comments

Comments

@timkelty
Copy link
Contributor

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.

@khalwat
Copy link
Contributor

khalwat commented Aug 10, 2018

...or even better, have a way to map it to the "real" URL for the site, so content authors can preview it.

@timkelty
Copy link
Contributor Author

timkelty commented Aug 10, 2018

...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: #1521 (comment)

@narration-sd
Copy link
Contributor

narration-sd commented Aug 10, 2018

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.

@brandonkelly
Copy link
Member

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.)

@timkelty
Copy link
Contributor Author

Good tip, @brandonkelly!

@narration-sd
Copy link
Contributor

narration-sd commented Aug 10, 2018 via email

@timkelty
Copy link
Contributor Author

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: #4275

@brandonkelly
Copy link
Member

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.

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

4 participants