title: How to include Ajax into a View if I don't use the layout.html in Web2py
body: <p>I am using an html template for a project where I don't use the the <code>layout.html</code>. I deleted the <code>{{extend 'layout.html'}}</code> from the View, however, I still want to use the <code>views/web2py_ajax.html</code>.</p>
  
  <p>I tried a couple of things: first I tried to put <code>{{include 'web2py_ajax.html'}}</code> in my <code>new_template.html</code> then <code>{{include}}</code> but that wasn't working. </p>
  
  <p>Then, I copied the code form the <code>views/web2py_ajax.html</code> file into my <code>new_template.html</code> View and that didn't seem to work.</p>
  
  <p>When I say <code>new_template.html</code> I mean the html template I use that is not the <code>layout.html</code>.</p>
  
  <p>In the <code>head</code> of the <code>new_template.html</code>, under all the <code>css</code> links and <code>js</code> scripts of the <code>new_template.html</code> I placed this:</p>
  
  <pre><code>{{include 'web2py_ajax.html'}}
      {{
    response.files.insert(0,URL('static','css/web2py.css'))
    response.files.insert(1,URL('static','css/bootstrap.min.css'))
    response.files.insert(2,URL('static','css/bootstrap-responsive.min.css'))
    response.files.insert(3,URL('static','css/web2py_bootstrap.css'))
    }} 
  </code></pre>
  
  <p>Then, in the <code>body</code> of the <code>new_template.html</code> I put:</p>
  
  <pre><code>{{include}}
  </code></pre>
  
  <p>I tested the <code>form</code> <code>submit</code> and the error messages are plain black text instead of the error messages in the red background box with white text. I know there must be a better way to test this but I am a little bit lost. What is the best way to do this?</p>
  
  <p>I'd appreciate some help with this.</p>