Answers.Body: <p>In the example code above, the query is retrieving a list of Entries and setting it to the variable <code>entries</code>.  Then, you are trying to loop through those Entries and treat them like they are a list of Assets.</p>
  
  <p>As noted in the comments, this was complicating the situation.</p>
  
  <p>It appears that, on the <code>entry.html</code> page, the <code>entry</code> variable was already available, as Craft makes that <code>entry</code> variable to all individual entry pages in Sections that have URLs.</p>
  
  <p>This makes accessing the Assets field on that page as simple as accessing a field, rather than needing to create a separate query to find the data.  From the comments above, the solution was to just access the appropriate Assets field on the Entry Page template and loop through them:</p>
  
  <pre><code>{% for asset in entry.entryFieldHandle %}
      &lt;img src="{{ asset.url }}"&gt;
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-23T05:32:54.027Z
Answers.LastActivityDate: 2015-08-23T05:32:54.027Z
Answers.UserDisplayName: Ben Parizek
Body: <p>I have a Structure section (<code>galeriesPhotos</code>) with two Entry Types:</p>
  
  <ul>
  <li><strong>Albums</strong> - the categories on the index.html page</li>
  <li><strong>Photos</strong> - the the actual gallery on the <code>entry.html</code></li>
  </ul>
  
  <p>I'm trying to display the images related to the "Albums" on <code>entry.html</code> like this:</p>
  
  <pre><code>{% set entries = craft.entries.section('galeriesPhotos').getEntryType('Photos') %}
  
  {% for image in entries %}
    &lt;img src="{{ image.getUrl }}"&gt;
  {% endfor %}
  </code></pre>
  
  <p>Nothing happens. I get a blank page without any errors. What I am doing wrong?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-16T09:53:56.137Z
Comments.Text: I think the for loop is incorrect, try changing {% for image in entries %} to {% for entry in entries %} and then change the img src to {{ entry.image.first().url }} Also if you switch on dev mode in the config it will help debug your templates.
Comments.UserDisplayName: pumkincreative
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-16T09:55:36.883Z
Comments.Text: Just tried that and it's not working
Comments.UserDisplayName: jjem
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-16T10:02:57.103Z
Comments.Text: It actually gives only the path to where the images are (<img src="http://www.example.com/gallery/2014/friday/") instead of the actual images that are uploaded in structure... Your suggestions give an error. Sorry
Comments.UserDisplayName: jjem
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-16T10:13:50.767Z
Comments.Text: Impossible to access an attribute ("url") on a NULL variable ("")
Comments.UserDisplayName: jjem
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-16T10:21:16.113Z
Comments.Text: OK sorry and thanks I entered the correct fieldHandle. It shows one image twice instead of all images that are related to this page. I guess I miss a relatedTo setting.
Comments.UserDisplayName: jjem
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-16T10:51:38.017Z
Comments.Text: Have a look at the Templating section on this page - http://buildwithcraft.com/docs/assets-fields
Comments.UserDisplayName: pumkincreative
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-16T12:09:14.013Z
Comments.Text: Thanks. I was looking way too far. This made it: `code`{% for asset in entry.entryFieldHandle %}
          <img src="{{ asset.url }}">
      {% endfor %}`code`
Comments.UserDisplayName: jjem
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-01-16T12:32:49.630Z
Comments.Text: Well done. Suggest you post your working code as an answer and tidy up the comments.
Comments.UserDisplayName: pumkincreative
Tags: <structure><entry-type><image>
Title: Display images from Structure
ThreadText: # Display images from Structure
  
  (Asked by: username_0 on 2015-01-16)
  
  I have a Structure section (`galeriesPhotos`) with two Entry Types:
  
  * **Albums** - the categories on the index.html page
  * **Photos** - the the actual gallery on the `entry.html`
  
  I'm trying to display the images related to the "Albums" on `entry.html` like this:
  
  ```
  {% set entries = craft.entries.section('galeriesPhotos').getEntryType('Photos') %}
  
  {% for image in entries %}
    <img src="{{ image.getUrl }}">
  {% endfor %}
  
  ```
  
  Nothing happens. I get a blank page without any errors. What I am doing wrong?
  
  **Tags:** structure, entry-type, image
  
  > **Comments:**
  > **username_1**: I think the for loop is incorrect, try changing {% for image in entries %} to {% for entry in entries %} and then change the img src to {{ entry.image.first().url }} Also if you switch on dev mode in the config it will help debug your templates.  
  > **username_0**: Just tried that and it's not working  
  > **username_0**: It actually gives only the path to where the images are (<img src="http://www.example.com/gallery/2014/friday/") instead of the actual images that are uploaded in structure... Your suggestions give an error. Sorry  
  > **username_0**: Impossible to access an attribute ("url") on a NULL variable ("")  
  > **username_0**: OK sorry and thanks I entered the correct fieldHandle. It shows one image twice instead of all images that are related to this page. I guess I miss a relatedTo setting.  
  > **username_1**: Have a look at the Templating section on this page - http://buildwithcraft.com/docs/assets-fields  
  > **username_0**: Thanks. I was looking way too far. This made it: `code`{% for asset in entry.entryFieldHandle %}         <img src="{{ asset.url }}">     {% endfor %}`code`  
  > **username_1**: Well done. Suggest you post your working code as an answer and tidy up the comments.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2015-08-23. Score: 2
  
  In the example code above, the query is retrieving a list of Entries and setting it to the variable `entries`. Then, you are trying to loop through those Entries and treat them like they are a list of Assets.
  
  As noted in the comments, this was complicating the situation.
  
  It appears that, on the `entry.html` page, the `entry` variable was already available, as Craft makes that `entry` variable to all individual entry pages in Sections that have URLs.
  
  This makes accessing the Assets field on that page as simple as accessing a field, rather than needing to create a separate query to find the data. From the comments above, the solution was to just access the appropriate Assets field on the Entry Page template and loop through them:
  
  ```
  {% for asset in entry.entryFieldHandle %}
      <img src="{{ asset.url }}">
  {% endfor %}
  
  ```
  
  
  ---
  
  