Answers.Body: <p>I'm not sure about displaying "the first image from the asset folder" but, you can display the first asset as it's situated in the entry itself. Would that work? Maybe something like this?</p>
  
  <pre><code>{% set assetFirst = entry.myAssetsField.first() %}
  
  {% if assetFirst %}
      {# or use getImg() (or either alias img/url): https://craftcms.com/docs/templating/assetfilemodel #}
      &lt;img src="{{ assetFirst.getUrl({ height: 400 }) }}" alt="image.title"/&gt;
  {% endif %}
  
  {% set assets = entry.assetsFieldHandle %}
  
  {% if assets | length %}
  
      {% for asset in assets %}
          {# https://craftcms.com/docs/templating/assetfilemodel#simple-output #}
          &lt;a href="{{ file.url }}"&gt;{{ file }}&lt;/a&gt;
      {% endfor %}
  
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-21T19:16:02.913Z
Answers.Text: This worked perfect Nathan, exactly what I was after.  Not sure if it was a silly question or not (my first Craft site), but thanks for the help!
Answers.UserDisplayName: conormcafee
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-21T19:16:44.687Z
Answers.Text: If this was your second site it would have been a silly question ;-)
Answers.UserDisplayName: Natetronn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-21T19:00:32.633Z
Answers.LastActivityDate: 2016-02-21T19:00:32.633Z
Answers.UserDisplayName: Natetronn
Body: <p>Basically, for every entry that I add to my 'Portfolio' channel, it creates a sub-folder inside assets/portfolio.</p>
  
  <p>For example I have:</p>
  
  <ul>
  <li>assets/portfolio/entry-one</li>
  <li>assets/portfolio/entry-two</li>
  </ul>
  
  <p>On my portfolio page, for each entry I want to display the first image from its asset folder and also get the url of every image in the folder.  </p>
  
  <p>Can anyone think of a solution that would allow me to do this? Can't figure out how to target each individual folder.  I know you can target folders by ID, but unless this can be somehow done dynamically in a loop it will not suit this situation. </p>
  
Tags: <assets><forloop><channels>
Title: How can I loop through a Channel entries asset folder?
ThreadText: # How can I loop through a Channel entries asset folder?
  
  (Asked by: username_0 on 2016-02-21)
  
  Basically, for every entry that I add to my 'Portfolio' channel, it creates a sub-folder inside assets/portfolio.
  
  For example I have:
  
  * assets/portfolio/entry-one
  * assets/portfolio/entry-two
  
  On my portfolio page, for each entry I want to display the first image from its asset folder and also get the url of every image in the folder.
  
  Can anyone think of a solution that would allow me to do this? Can't figure out how to target each individual folder. I know you can target folders by ID, but unless this can be somehow done dynamically in a loop it will not suit this situation.
  
  **Tags:** assets, forloop, channels
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-02-21. Score: 1 | Accepted answer
  
  I'm not sure about displaying "the first image from the asset folder" but, you can display the first asset as it's situated in the entry itself. Would that work? Maybe something like this?
  
  ```
  {% set assetFirst = entry.myAssetsField.first() %}
  
  {% if assetFirst %}
      {# or use getImg() (or either alias img/url): https://craftcms.com/docs/templating/assetfilemodel #}
      <img src="{{ assetFirst.getUrl({ height: 400 }) }}" alt="image.title"/>
  {% endif %}
  
  {% set assets = entry.assetsFieldHandle %}
  
  {% if assets | length %}
  
      {% for asset in assets %}
          {# https://craftcms.com/docs/templating/assetfilemodel#simple-output #}
          <a href="{{ file.url }}">{{ file }}</a>
      {% endfor %}
  
  {% endif %}
  
  ```
  
  > **Comments:**
  > **username_0**: This worked perfect Nathan, exactly what I was after.  Not sure if it was a silly question or not (my first Craft site), but thanks for the help!  
  > **username_1**: If this was your second site it would have been a silly question ;-)  
  
  ---
  
  