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>
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
    Commented Aug 6, 2014 at 0:19
  • What happens when in your network-logger when you change something during live-preview?
    – Victor
    Commented Aug 6, 2014 at 0: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
    Commented Aug 6, 2014 at 0:29
  • This is also coming up:: GET use.typekit.net/c/e41e7d/… [HTTP/1.1 403 Forbidden 50ms]
    – user630
    Commented Aug 6, 2014 at 0:32

3 Answers 3

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.

1
  • 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
    Commented Feb 27, 2017 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.

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 }}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.