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

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

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, privacy policy and cookie policy

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