<blockquote>
  <p>Variable "entry" does not exist</p>
</blockquote>

<p>This error is being caused by the first line of your code:</p>

<p><code>... in entry.isotope %}</code></p>

<p>You are either using this template code on an element that isn't an entry or haven't defined a variable called <code>entry</code> anywhere.</p>

<p>So we can help you more, what type of element is this field being used on?</p>

CC BY-SA 3.0
2016-09-06T16:52:12.563Z
For entries under  the channel section `posts`.
Hellyar
CC BY-SA 3.0
2016-09-06T18:13:41.043Z
...so, how do I point to a `field` called/ with the handle `isotope` that appears in the entries section `posts`
Hellyar
CC BY-SA 3.0
2016-09-06T19:07:25.357Z
The votes are from others here who feel that Jamie is being helpful with his answer. His answer is entirely correct. You are getting the error because either a) you are not on a template page, or b) you are not calling entry in any way. That is why you are getting the error. You still have not indicated where and how you are trying to output this and he's giving you the best push forward to solving this with what you've supplied.
AbbeyDesign
CC BY-SA 3.0
2016-09-06T19:19:27.933Z
Have you assigned the field called isotope to the section "Posts"? Under Settings >> Sections >> Edit Entry Type
AbbeyDesign
CC BY-SA 3.0
2016-09-07T13:52:51.593Z
Yes, `isotope` is assigned to the entry type associated with `posts`.  And I can successfully pull the assigned value for a given entry to use it as a class name in my HTML.
Hellyar
CC BY-SA 3.0
2016-09-06T16:05:38.603Z
2016-09-06T16:05:38.603Z
Jamie Wade
<p>I have a field <code>isotope</code>.  It's a dropdown field with a single word text input.   Only one value (out of 6) can be assigned to an entry.  It is not a tag.  It is not a category.  </p>

<p>I want to create a button for each value within the <code>isotope</code> field. </p>

<pre><code>{% for button in entry.isotope %}  

    &lt;button class="button" data-filter="{{button.title}}"&gt;{{button.title}}&lt;/button&gt;

{% endear %}
</code></pre>

<p>This is wrong and generates the error <code>Variable "entry" does not exist</code>.  I know this is basic, but I am obviously missing something.  </p>

CC BY-SA 3.0
2016-09-06T16:03:09.117Z
Where are you trying to output this? The error indicates you're not on an entry template or have not set "entry".
AbbeyDesign
<templating><field>
How can I loop through a field and print each value individually?
# How can I loop through a field and print each value individually?

(Asked by: username_0 on 2016-09-06)

I have a field isotope.  It's a dropdown field with a single word text input.   Only one value (out of 6) can be assigned to an entry.  It is not a tag.  It is not a category.  
I want to create a button for each value within the isotope field. 
{% for button in entry.isotope %}  

    {{button.title}}

{% endear %}

This is wrong and generates the error Variable "entry" does not exist.  I know this is basic, but I am obviously missing something.

**Tags:** templating, field

> **Comments:**
> **username_1**: Where are you trying to output this? The error indicates you're not on an entry template or have not set "entry".  

---

## 1 answers

### Answer by username_2 on 2016-09-06. Score: 3 | Accepted answer

> Variable "entry" does not exist

This error is being caused by the first line of your code:

`... in entry.isotope %}`

You are either using this template code on an element that isn't an entry or haven't defined a variable called `entry` anywhere.

So we can help you more, what type of element is this field being used on?

> **Comments:**
> **username_0**: For entries under  the channel section `posts`.  
> **username_0**: ...so, how do I point to a `field` called/ with the handle `isotope` that appears in the entries section `posts`  
> **username_1**: The votes are from others here who feel that Jamie is being helpful with his answer. His answer is entirely correct. You are getting the error because either a) you are not on a template page, or b) you are not calling entry in any way. That is why you are getting the error. You still have not indicated where and how you are trying to output this and he's giving you the best push forward to solving this with what you've supplied.  
> **username_1**: Have you assigned the field called isotope to the section "Posts"? Under Settings >> Sections >> Edit Entry Type  
> **username_0**: Yes, `isotope` is assigned to the entry type associated with `posts`.  And I can successfully pull the assigned value for a given entry to use it as a class name in my HTML.  

---

