Template error: A template that extends another one cannot have a body How am I able to use bootstrap in Craft? I created a folder in a templates directory named _layouts and inside of that I have base.html

&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;meta charset="UTF-8"&gt;
&lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"&gt;
&lt;/head&gt;

&lt;/html&gt;


and this is where i want to include the bootstrap (contact.html)

{% extends "_layouts/base" %}
{% macro errorList(errors) %}
{% if errors %}
&lt;ul class="errors"&gt;
{% for error in errors %}
            &lt;li&gt;{{ error }}&lt;/li&gt;
        {% endfor %}
    &lt;/ul&gt;
{% endif %}
{% endmacro %}
{% from _self import errorList %}


&lt;form method="post" action="" accept-charset="UTF-8"&gt;
{{ getCsrfInput() }}
&lt;input type="hidden" name="action" value="contactForm/sendMessage"&gt;
&lt;input type="hidden" name="redirect" value="../public/index.php/contact.html"&gt;

&lt;h3&gt;&lt;label for="fromName"&gt;Your Name&lt;/label&gt;&lt;/h3&gt;
&lt;input id="fromName" type="text" name="fromName" value="{% if message is defined %}{{ message.fromName }}{% endif %}"&gt;
{{ message is defined and message ? errorList(message.getErrors('fromName')) }}

&lt;h3&gt;&lt;label for="fromEmail"&gt;Your Email&lt;/label&gt;&lt;/h3&gt;
&lt;input id="fromEmail" type="email" name="fromEmail" value="{% if message is defined %}{{ message.fromEmail }}{% endif %}"&gt;
{{ message is defined and message ? errorList(message.getErrors('fromEmail')) }}

&lt;h3&gt;&lt;label for="message"&gt;Message&lt;/label&gt;&lt;/h3&gt;
&lt;textarea rows="10" cols="40" id="message" name="message"&gt;{% if message is defined %}{{ message.message }}{% endif %}&lt;/textarea&gt;
{{ message is defined and message ? errorList(message.getErrors('message')) }}

&lt;input type="submit" class = "btn btn-submit" value="Send"&gt;
&lt;/form&gt;


I'm having an error => "A template that extends another one cannot have a body."
In your base.html you need to include a block section, so something like this:

&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;meta charset="UTF-8"&gt;
&lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"&gt;
&lt;/head&gt;
&lt;body&gt;
{% block content %}{% endblock %}
&lt;/body&gt;
&lt;/html&gt;


Then in your contact.html you need to wrap your main markup in the same block, like this:

{% extends "_layouts/base" %}
{% macro errorList(errors) %}
{% if errors %}
&lt;ul class="errors"&gt;
{% for error in errors %}
            &lt;li&gt;{{ error }}&lt;/li&gt;
        {% endfor %}
    &lt;/ul&gt;
{% endif %}
{% endmacro %}
{% from _self import errorList %}

{% block content %}
&lt;form method="post" action="" accept-charset="UTF-8"&gt;
{{ getCsrfInput() }}
&lt;input type="hidden" name="action" value="contactForm/sendMessage"&gt;
&lt;input type="hidden" name="redirect" value="../public/index.php/contact.html"&gt;

&lt;h3&gt;&lt;label for="fromName"&gt;Your Name&lt;/label&gt;&lt;/h3&gt;
&lt;input id="fromName" type="text" name="fromName" value="{% if message is defined %}{{ message.fromName }}{% endif %}"&gt;
{{ message is defined and message ? errorList(message.getErrors('fromName')) }}

&lt;h3&gt;&lt;label for="fromEmail"&gt;Your Email&lt;/label&gt;&lt;/h3&gt;
&lt;input id="fromEmail" type="email" name="fromEmail" value="{% if message is defined %}{{ message.fromEmail }}{% endif %}"&gt;
{{ message is defined and message ? errorList(message.getErrors('fromEmail')) }}

&lt;h3&gt;&lt;label for="message"&gt;Message&lt;/label&gt;&lt;/h3&gt;
&lt;textarea rows="10" cols="40" id="message" name="message"&gt;{% if message is defined %}{{ message.message }}{% endif %}&lt;/textarea&gt;
{{ message is defined and message ? errorList(message.getErrors('message')) }}

&lt;input type="submit" class = "btn btn-submit" value="Send"&gt;
&lt;/form&gt;
{% endblock %}


So you are basically saying create an area called content in your base.html and you want to fill this area with the markup wrapped in the content block inside your contact.html. You can call the block whatever you want, so here we've called it content, it doesn't have to be that, but it seems a fairly logical name for it.

You can have more than one block in your base.html, if you want. For instance you could have a header, content and footer blocks. All you need to remember is to use the same names inside the template file you are extending the base.html from. 

More information can be found in the Twig documentation