8 votes

Live preview not automatically updating

There is a known issue where if you use a variable name 'entry' in any template involved in a Live Preview request (including layout templates), then it can cause the behavior you're seeing. Some ...
user avatar
  • 66.4k
7 votes

No live preview available when entry status is set to disabled?

Live Preview will be available when the following are true: The section’s “Entries in this section have their own URLs” setting is checked The section’s “Entry Template” setting points to a valid ...
user avatar
7 votes
Accepted

Live Preview has No Style

Not sure what your end url is but I think you'll need either a "/" or {{ siteUrl }} before "assets" in "assets/bootstrap/css/bootstrap.min.css". so (for all references to css etc.) <link href="{{ ...
user avatar
  • 1,517
6 votes

Live Preview not working

Just want to mention for anyone running across this thread that if you're having a problem with live preview and seeing dev tools errors of the nature of cors or crossdomain then the first thing you ...
user avatar
  • 179
6 votes

Live Preview not working

Another cause of Live Preview not working that can be a pain to debug, because there are no 'errors' as such is your .htaccess setup. For example, on one site we had the following .htaccess entry to ...
user avatar
6 votes
Accepted

Live preview using Vue.js

Craft 3.2 introduces Headless Preview which works a treat with SPA's. Essentially Craft exposes tokens which you can forward on to subsequent Element API requests and Craft will do the rest. The ...
user avatar
  • 221
5 votes
Accepted

Is it possible to prevent disabled Matrix Blocks showing in a Live Preview?

It's definitely a bug in live preview but looks like you can work around it. This doesn't appear documented at all—so be careful—but you can use .status() to get the block's status. It looks like an ...
user avatar
  • 6,442
5 votes
Accepted

When using .limit on matrix blocks they don't show in live preview

I noticed the same issue with live preview, but using the type property on the Matrix field: Issue with Matrix type property and Live Preview? According to Brandon's answer this is a current bug / ...
user avatar
  • 35.8k
5 votes
Accepted

Issue with Matrix `type` property and Live Preview?

Live preview have gone through a major refactoring for Craft 3.2, which addresses this issue. For Craft 3.1 and below see solutions below. This is happening because Matrix will only show the non-live ...
user avatar
5 votes
Accepted

Apply different classes and styles when in 'live preview' pane

Craft's Request service has a built-in method for this, isLivePreview. Here's how to only display content in the live preview view: {% if craft.request.isLivePreview %} <p>Only appears in ...
user avatar
4 votes
Accepted

Live Preview only works for Entry variable?

We just changed this behavior in Craft 2.3.2616: Live Preview and Share links will now show the unpublished entry/category changes wherever the entry/category are being referenced in the templates (...
user avatar
4 votes

Live Preview not working

Accepted answer helped me, my issue was Ajax related as well! Here is an example of the code I ended up using in my template. {% extends (craft.request.isAjax and not craft.request.isLivePreview) ? "...
user avatar
  • 173
4 votes
Accepted

Description and logo at the very top of browser?

Site title - This is set with HTML meta tags and not really anything to do with Craft specifically. It depends how you "switched" from wordpress to Craft. Inside your document head, you need to ...
user avatar
  • 3,195
4 votes
Accepted

What configuration does Craft need to enable Live View on hoster CloudFlare with SSL/https CP?

I'm not completely sure, but would setting site_url to always be whatever the server host is work in this case? In my general.php I use the following before the config array: $protocol = (isset($...
user avatar
  • 2,301
3 votes

Multi locale, multi-domain Live Preview failing

Only setting headers in .htaccess doesn't fix the problem. As Marion Newlevant points out in her answer the cross domain works with the headers set. But you still get a white page as a preview. ...
user avatar
3 votes
Accepted

Live Preview error when entry is disabled

Change: {% for entry in craft.entries.section('flashback') %} To: {% for entry in craft.entries.section('flashback').status(null) %} The 2nd one will grab all entries regardless of their enabled/...
user avatar
  • 66.4k
3 votes
Accepted

Does Google Analytics track Live Preview 'page views'?

If you're using SEOmatic - no. It's built in that the GA doesn't get spat out for the preview. If you're using a regular template - yes; you may want to wrap your GA code in a conditional so that it's ...
user avatar
  • 3,084
3 votes

Live Preview failing in Safari and Firefox only

CORS (or Cross-Origin Resource Sharing) issues usually occur when you are attempting to load a resource such as a font, a stylesheet, or a script from a remote location that does not give your domain ...
user avatar
3 votes
Accepted

Live Preview failing in Safari and Firefox only

Ok, so after going through the logs in craft/storage/runtime I found the problem. I'm using environment variables for my sites url and had it set to: mysite.com However when going to the site ...
user avatar
3 votes
Accepted

Two domains - single install - Live Preview works only on one

In order to get Live Preview to work across different subdomains on a single install, you'll need to setup a few extra things as outlined in this support article: https://craftcms.com/support/cross-...
user avatar
  • 66.4k
3 votes

Live preview using Vue.js

Update: As of Craft 3.2 there is native support for headless previews. Please see Cue's extensive answer for a detailed explanation. Original answer I managed to do this, although I'm still not quite ...
user avatar
3 votes

Headless CraftCMS: How can I tell Craft to load live preview from a different (sub)domain?

Since Craft 3.3.1, you can create a custom alias that resolves to your frontend base URL, and add that alias to the relevant preview targets' "URL Format" setting. For example, assuming you put ...
user avatar
2 votes

Live preview not automatically updating

Be sure to look for JavaScript errors as well! I was having the same trouble with a CloudFlare-enabled site, and it turned out that the Rocket Loader feature was choking and keeping previews from ...
user avatar
  • 3,921
2 votes

Live Preview and Twig blocks

The problem was my attempt to ajaxify the page. I had my block content wrapped around {% if not craft.request.isAjax %} the page also gets loaded in via Ajax into the control panel, I changed the ...
user avatar
  • 539
2 votes
Accepted

Live Preview not working

Looks like it's generating a 500 Internal Server Error which means the underlying error message should be getting logged into your craft/storage/runtime/logs files. Just reproduce the problem and ...
user avatar
  • 66.4k
2 votes

Live Preview only works for Entry variable?

Update: Thanks to P&T this workaround is not necessary any more with Craft 2.3.2616! This was my temporary solution / bugfix: I think you're right, Live Preview seems to only update if changes ...
user avatar
  • 35.8k
2 votes
Accepted

Live Preview Items Without Entry URL

It is (currently) not possible to set an Entry Template without selecting "Entries in this section have their own URLs" in the settings. So to make Live Preview available on your "slides" entries, you ...
user avatar
  • 35.8k
2 votes

Previewing different languages

If you define your base site URLs using the siteUrl config setting (using the array syntax), then clicking the “Share” button should bring you to the appropriate locale’s URL.
user avatar
2 votes

Live Preview: Hide tabs from live preview

There is currently no out-of-the-box way to do that. You might be able to pull it off with something like the CP-CSS plugin, but I'm not sure how you'd just target the tab when the Live Preview pane ...
user avatar
  • 66.4k
2 votes

Live Preview not working

Another possible source of Live Preview not working is your siteUrl config setting pointing to the wrong environment in a multi-environment setting. I had this problem when I'd set siteUrl globally ...
user avatar
  • 1,215

Only top scored, non community-wiki answers of a minimum length are eligible