6

any help would be much appreciated.

I have Live Preview working on my entries ie. I can see and use the button, but the live preview won't update as I manipulate the content? It was working before so it is baffling me as to how it could stop working.

The only change I think I have made in that time is removing the open_basedir settings in my php.ini, but I wouldn;t imagine that would affect it?

Thanks,

Dc

UPDATE::

This is the htaccess code:

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]
</IfModule>
user630
  • 61
  • 4
  • I had a smilar issue a while back: Can you post your .htaccess code, and also check whether your Inspector-Network-log shows something. – Victor Aug 06 '14 at 00:19
  • What happens when in your network-logger when you change something during live-preview? – Victor Aug 06 '14 at 00:28
  • There is this message not sure if its related: "Element was added to more than one selector" garnish-0.1.min.js:11 – user630 Aug 06 '14 at 00:29
  • This is also coming up:: GET http://use.typekit.net/c/e41e7d/futura-pt:i3:i4:i5:i7:i8:n3:n4:n5:n7:n8.SH7:P:2,SH9:P:2,SH4:P:2,SH6:P:2,SHD:P:2,SHB:P:2,Y5K:P:2,SH3:P:2,SH5:P:2,SHC:P:2/d [HTTP/1.1 403 Forbidden 50ms] – user630 Aug 06 '14 at 00:32

3 Answers3

8

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 examples are:

{% set entry = craft.entries. ... .find() %}

or

{% for entry in craft.entries. ... .find() %}

The workaround is to rename that variable to something else. myEntry, for example.

Brad Bell
  • 67,440
  • 6
  • 73
  • 143
  • Is this still a problem in the current version (2.6.2963) of Craft? I’m having problems with live preview as well and wonder if this could be the cause. – periodical Feb 27 '17 at 17:05
2

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 working properly. Otherwise no entry variables in play.

Matt Stein
  • 4,006
  • 3
  • 26
  • 57
1

Brad & Matt provided good suggestions, but we just found another case where this can happen – when using matrix blocks with special filters or conditions.

In Craft 2.6 I found that this line does not update during Live Preview, but instead uses the last saved revision:

{{ entry.banner.type('bannerContent').first().bannerTitle }}

Whereas this line works fine:

{{ entry.banner.first().bannerTitle }}
Simon East
  • 890
  • 6
  • 21