<p>I'd simplify the entry like so</p>

<pre><code>   {% set entry = craft.entries.id(5) %}
   {{ entry.title }}
</code></pre>

CC BY-SA 3.0
2016-07-20T15:57:36.433Z
This made me realize I had the for loop outside of the block. As soon as I moved the loop inside the block it worked. I'm such a noob
CreateSean
CC BY-SA 3.0
2016-07-20T15:55:35.107Z
2016-07-20T15:55:35.107Z
Steven Grant
<p>Working on my first craft site and I'm setting up a thankyou template for after a form submission, but am getting an error when calling the contact entry (it's a single).</p>

<p>I've tried several code variations with no luck. This is my current template</p>

<pre><code>{#
 # Contact Thank You template
 # ---------------
 #}

{% extends "_layout" %}

{# pass body id to layout template #}
{% set bodyId = 'contact' %}

    {% set entries = craft.entries.section('contact').id(5).find() %}
    {% for entry in entries %}

        {# Top Images/Slider Content Here #}
        {% block headImage %}
        {{ entry.title }}

        {% endblock %}

    {% endfor %}{# end contact entry for loop #}
</code></pre>

<p>Please advise.</p>

CC BY-SA 3.0
2016-07-20T15:54:59.763Z
What's the `block headImage` doing?
Steven Grant
CC BY-SA 3.0
2016-07-20T15:56:25.543Z
That block is in the layout template and is usually replaced with an image from the entry. I've just removed the image for testing purposes and am tryiing to pull in the title
CreateSean
<templating><error>
Variable "entry" does not exist
# Variable "entry" does not exist

(Asked by: username_0 on 2016-07-20)

Working on my first craft site and I'm setting up a thankyou template for after a form submission, but am getting an error when calling the contact entry (it's a single).
I've tried several code variations with no luck. This is my current template
{#
 # Contact Thank You template
 # ---------------
 #}

{% extends "_layout" %}

{# pass body id to layout template #}
{% set bodyId = 'contact' %}

    {% set entries = craft.entries.section('contact').id(5).find() %}
    {% for entry in entries %}

        {# Top Images/Slider Content Here #}
        {% block headImage %}
        {{ entry.title }}

        {% endblock %}

    {% endfor %}{# end contact entry for loop #}

Please advise.

**Tags:** templating, error

> **Comments:**
> **username_1**: What's the `block headImage` doing?  
> **username_0**: That block is in the layout template and is usually replaced with an image from the entry. I've just removed the image for testing purposes and am tryiing to pull in the title  

---

## 1 answers

### Answer by username_1 on 2016-07-20. Score: 3 | Accepted answer

I'd simplify the entry like so
   {% set entry = craft.entries.id(5) %}
   {{ entry.title }}

> **Comments:**
> **username_0**: This made me realize I had the for loop outside of the block. As soon as I moved the loop inside the block it worked. I'm such a noob  

---

