Answers.Body: <p>The problem was my attempt to ajaxify the page.</p>
  
  <p>I had my block content wrapped around
  <code>{% if not craft.request.isAjax %}</code></p>
  
  <p>the page also gets loaded in via Ajax into the control panel, I changed the code to:<br>
  <code>{% if not craft.request.isAjax or craft.request.isLivePreview %}</code></p>
  
  <p>Now it works.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-09T08:43:37.563Z
Answers.LastActivityDate: 2014-09-09T11:45:16.797Z
Answers.LastEditDate: 2014-09-09T11:45:16.797Z
Answers.UserDisplayName: nexflo
Body: <p>I'm using <code>{% block content %}</code> and a main layout file.</p>
  
  <p>When using live preview the "entire" frame isn't shown (including layout files).</p>
  
  <p>Is there an easy way to get the whole template in?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-03T22:47:54.760Z
Comments.Text: That's strange, because live preview should be working with Twig extends. Does this template load ok for you if you access it outside of live preview? Any errors if you enable dev mode?
Comments.UserDisplayName: carlcs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-04T13:33:18.343Z
Comments.Text: Yup, loads just fine.
  The structure is: i have one _layout.html with a     
  {% block content %}{% endblock %}
  
  and in the pages folder i got the corresponding pages i.e. _news.html which have all content inside 
  
  {% block content %}
      content goes here
  {% endblock %}
Comments.UserDisplayName: nexflo
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-04T13:43:01.450Z
Comments.Text: Can you post more code and tell us more about what is shown in live preview (what's that entire frame and what do you mean with including layout files)?
Comments.UserDisplayName: carlcs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-06T12:02:10.037Z
Comments.Text: Live preview definitely works with twig blocks, I've got it working on all my sites. You'll need to post your template code to get it looked at in more detail
Comments.UserDisplayName: darylknight
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-09T08:32:37.590Z
Comments.Text: Ah i think i found out why. (this kinda correlated with my localized templates question)
  
  I created a pages/_entry.html which loads all the subpages according to some variables...
  
  {% extends "_layout" %}
  
  {% block content %}
  
           {% include ["pages/_#{entry.type}", "pages/_#{entry.slug}.html", 'pages/_default.html'] %}
  
          {% endif %}
  
  
  {% endblock %}
  
  Could it be that craft loads the page directly...and not the way its loaded in the frontend? That way the extend of layout is no longer visible. Guess i could check in every template if its a preview and extend again from _layout
Comments.UserDisplayName: nexflo
Tags: <live-preview>
Title: Live Preview and Twig blocks
ThreadText: # Live Preview and Twig blocks
  
  (Asked by: username_0 on 2014-09-03)
  
  I'm using `{% block content %}` and a main layout file.
  
  When using live preview the "entire" frame isn't shown (including layout files).
  
  Is there an easy way to get the whole template in?
  
  **Tags:** live-preview
  
  > **Comments:**
  > **username_1**: That's strange, because live preview should be working with Twig extends. Does this template load ok for you if you access it outside of live preview? Any errors if you enable dev mode?  
  > **username_0**: Yup, loads just fine. The structure is: i have one _layout.html with a      {% block content %}{% endblock %}  and in the pages folder i got the corresponding pages i.e. _news.html which have all content inside   {% block content %}     content goes here {% endblock %}  
  > **username_1**: Can you post more code and tell us more about what is shown in live preview (what's that entire frame and what do you mean with including layout files)?  
  > **username_2**: Live preview definitely works with twig blocks, I've got it working on all my sites. You'll need to post your template code to get it looked at in more detail  
  > **username_0**: Ah i think i found out why. (this kinda correlated with my localized templates question)  I created a pages/_entry.html which loads all the subpages according to some variables...  {% extends "_layout" %}  {% block content %}           {% include ["pages/_#{entry.type}", "pages/_#{entry.slug}.html", 'pages/_default.html'] %}          {% endif %}   {% endblock %}  Could it be that craft loads the page directly...and not the way its loaded in the frontend? That way the extend of layout is no longer visible. Guess i could check in every template if its a preview and extend again from _layout  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2014-09-09. Score: 2
  
  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 code to:  
  `{% if not craft.request.isAjax or craft.request.isLivePreview %}`
  
  Now it works.
  
  
  ---
  
  