<p>It looks like you're trying to access another asset within your assets (asset meta field).</p>

<pre><code>{% set photos = entry.photos %}

{# Loop assets of `entry.photos` as `photo` #}
{% for photo in photos %}

    {# Get first `uploadPhoto` element within `entry.photos[nth]` #}
    {% set image = photo.uploadPhoto.first() %}
    {{ image.getUrl() }}

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

<p>I guess that's not what you want. Check your field handles again, you probably only need to do this.</p>

<pre><code>{% set photos = entry.photos %}

{% for photo in photos %}
    {{ photo.getUrl() }}
{% endfor %}
</code></pre>

<p>If 'uploadPhoto' is an asset source and you allow users to upload to multiple sources, but only want to loop assets from 'uploadPhoto' in your template, you would do this like so.</p>

<pre><code>{% set photos = entry.photos.source('uploadPhoto') %}
</code></pre>

CC BY-SA 3.0
2015-03-25T09:05:36.980Z
2015-03-25T09:38:39.970Z
2015-03-25T09:38:39.970Z
carlcs
<p>Please refer <a href="https://craftcms.stackexchange.com/questions/8821/multiple-photos-assets-in-one-upload-entry/8837#8837">to this thread</a> for information leading up to this problem.</p>

<p>I am having problems with mass file uploads, the files will upload in my CP for craft, and be present on the assets list, however when I come to post the entry, only one image will show on my live page.</p>

<p>Here is my code: </p>

<pre><code>{% extends "_layout/_layout" %}

{% set bodyClass = "photos" %}

{% block metaTitle %}{{ entry.title }} Photo Gallery{% endblock %}
{% block metaDescription %}{{ entry.metaDescription }}{% endblock %}

    {% block content %}
              &lt;div class="container"&gt;
                    &lt;div class="page-title-heading"&gt;
                        &lt;h1&gt;{{ entry.title }}&lt;/h1&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class="title-border"&gt;&lt;/div&gt;

        &lt;div class="portfolio-container"&gt;
        {{ entry.body }}

        &lt;ul id="portfolio-items-one-fourth" class="portfolio-items-one-fourth clearfix"&gt;
            {% set photos = entry.photos %}
            {% if photos | length %}
            {% for photo in photos %}
            &lt;li class="item photo" style="display: inline-block; opacity: 1;"&gt;
                &lt;div class="item-content"&gt;
                    &lt;div class="link-holder"&gt;
                        &lt;div class="portfolio-item-holder"&gt;
                            &lt;div class="portfolio-item-hover-content"&gt;
                                {% set image = photo.uploadPhoto.first() %}
                                &lt;a href="{{ image.getUrl('photoLightbox') }}" class="fancybox" rel="gallery" title="{{ photo.photoCaption }}"&gt;
                                    &lt;img src="{{ image.getUrl('photoListing') }}" width="270" class="portfolio-img"&gt;
                                &lt;/a&gt;
                            &lt;/div&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/li&gt;
            {% endfor %}
            {% endif %}
        &lt;/ul&gt;
    &lt;/div&gt;

    &lt;p class="next-prev gallery-links"&gt;
        {% set prev = entry.getPrev({'section' : entry.section.handle}) %}
        {% set next = entry.getNext({'section' : entry.section.handle}) %}
        {% if prev %}&lt;a href="{{ prev.url }}"&gt;&amp;laquo; {{ prev }}&lt;/a&gt;{% endif %}
        {% if next %}&lt;a href="{{ next.url }}"&gt;{{ next }} &amp;raquo;&lt;/a&gt;{% endif %}
    &lt;/p&gt;
    &lt;p class="photo-credits gallery-links"&gt;
        &lt;a href="/photo-credits"&gt;Photographer credits&lt;/a&gt;.
    &lt;/p&gt;

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

<p>Any help with rectifying this code would be absolutely wholeheartedly appreciated!</p>

<p>Thank you!</p>

CC BY-SA 3.0
2015-03-25T08:42:32.343Z
Is ```entry.photos``` a Matrix field or an Assets field?
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2015-03-25T08:53:41.953Z
An assets field @MatsMikkelRummelhoff
Harkat
<assets><upload>
Uploaded photos not showing on entry
# Uploaded photos not showing on entry

(Asked by: username_0 on 2015-03-25)

Please refer to this thread for information leading up to this problem.
I am having problems with mass file uploads, the files will upload in my CP for craft, and be present on the assets list, however when I come to post the entry, only one image will show on my live page.
Here is my code: 
{% extends "_layout/_layout" %}

{% set bodyClass = "photos" %}

{% block metaTitle %}{{ entry.title }} Photo Gallery{% endblock %}
{% block metaDescription %}{{ entry.metaDescription }}{% endblock %}

    {% block content %}
              
                    
                        {{ entry.title }}
                    
                
                

        
        {{ entry.body }}

        
            {% set photos = entry.photos %}
            {% if photos | length %}
            {% for photo in photos %}
            
                
                    
                        
                            
                                {% set image = photo.uploadPhoto.first() %}
                                
                                    
                                
                            
                        
                    
                
            
            {% endfor %}
            {% endif %}
        
    

    
        {% set prev = entry.getPrev({'section' : entry.section.handle}) %}
        {% set next = entry.getNext({'section' : entry.section.handle}) %}
        {% if prev %}« {{ prev }}{% endif %}
        {% if next %}{{ next }} »{% endif %}
    
    
        Photographer credits.
    

    {% endblock %}

Any help with rectifying this code would be absolutely wholeheartedly appreciated!
Thank you!

**Tags:** assets, upload

> **Comments:**
> **username_1**: Is ```entry.photos``` a Matrix field or an Assets field?  
> **username_0**: An assets field @MatsMikkelRummelhoff  

---

## 1 answers

### Answer by username_2 on 2015-03-25. Score: 3

It looks like you're trying to access another asset within your assets (asset meta field).
{% set photos = entry.photos %}

{# Loop assets of `entry.photos` as `photo` #}
{% for photo in photos %}

    {# Get first `uploadPhoto` element within `entry.photos[nth]` #}
    {% set image = photo.uploadPhoto.first() %}
    {{ image.getUrl() }}

{% endfor %}

I guess that's not what you want. Check your field handles again, you probably only need to do this.
{% set photos = entry.photos %}

{% for photo in photos %}
    {{ photo.getUrl() }}
{% endfor %}

If 'uploadPhoto' is an asset source and you allow users to upload to multiple sources, but only want to loop assets from 'uploadPhoto' in your template, you would do this like so.
{% set photos = entry.photos.source('uploadPhoto') %}


---

