<p>I found this to work for what I needed:</p>

<pre><code>{% set nextImage = image.getNext() %}
{% if nextImage %}

    {% if nextImage.checkboxFieldHandle.contains('value') %}
        {# Do something #}
    {% endif %}

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

CC BY-SA 3.0
2014-11-28T10:55:09.303Z
2014-11-28T10:55:09.303Z
James
<p>I never used that <a href="http://buildwithcraft.com/docs/templating/assetfilemodel#getNext" rel="nofollow"><code>getNext()</code></a> method with <code>craft.asset</code>, but maybe it works if you explicitly feed it with parameters?</p>

<p>Another idea is to use loop variables:</p>

<pre><code>{% set myClass = not loop.last and entry.myAssets[loop.index].fieldName == '1' ? ' YEY' %}
</code></pre>

CC BY-SA 3.0
2014-10-24T15:11:24.737Z
2014-10-24T15:11:24.737Z
carlcs
<p><code>asset.getNext().fieldName</code> does not work but might help explain what I was aiming for.</p>

<p>To be more specific, for where there are multiple images in an entry, I want to assign a class to each depending on its next image’s field value. Also, the field I’m trying to get a value from is a radio field.</p>

CC BY-SA 3.0
2014-10-24T13:06:37.680Z
Not really - can you please post more detail?
Brandon Kelly
CC BY-SA 3.0
2014-10-24T13:31:53.507Z
Can you post your full template code? Sounds like `asset.getNext().fieldName` should work, but hard to tell without seeing more code.
Brandon Kelly
<assets>
How to get a field value from next/prev asset
# How to get a field value from next/prev asset

(Asked by: username_0 on 2014-10-24)

`asset.getNext().fieldName` does not work but might help explain what I was aiming for.

To be more specific, for where there are multiple images in an entry, I want to assign a class to each depending on its next image’s field value. Also, the field I’m trying to get a value from is a radio field.

**Tags:** assets
> **Comments:**
> **username_1**: Not really - can you please post more detail?  
> **username_1**: Can you post your full template code? Sounds like `asset.getNext().fieldName` should work, but hard to tell without seeing more code.  

---

## 2 answers

### Answer by username_0 on 2014-11-28. Score: 2 | Accepted answer

I found this to work for what I needed:
{% set nextImage = image.getNext() %}
{% if nextImage %}

    {% if nextImage.checkboxFieldHandle.contains('value') %}
        {# Do something #}
    {% endif %}

{% endif %}


---

### Answer by username_2 on 2014-10-24. Score: 1

I never used that getNext() method with craft.asset, but maybe it works if you explicitly feed it with parameters?
Another idea is to use loop variables:
{% set myClass = not loop.last and entry.myAssets[loop.index].fieldName == '1' ? ' YEY' %}


---

