Answers.Body: <p>It's tough to see the full context, just based on what you have here. From what I can tell, it seems like you might need to change <code>&lt;img src="{{ image.file }}" alt=""&gt;</code> to <code>&lt;img src="{{ image.file.first().url }}" alt=""&gt;</code>.</p>
  
  <p>Since the asset field can hold many assets, you have to declare <code>.first()</code> to grab the first one -- even if there's only one image. Then you have to grab the <code>url</code> property from the image, in order to get the correct <code>src</code> value.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-01T15:48:44.703Z
Answers.LastActivityDate: 2017-06-01T15:48:44.703Z
Answers.UserDisplayName: Scott Stubblefield
Body: <p>I am using the <a href="https://github.com/benjamminf/craft-neo/wiki" rel="nofollow noreferrer">Neo</a> plugin in my project. I have made a Neofield <code>article content</code> with several block types in it. Amongst the block types that I have in it, is a <code>gallery</code> as well. Gallery block type has a<code>matrix</code> field <code>imageWithCaption</code>, and the field <code>imageWithCaption</code> has fields <code>file</code> which is the assets field, and fields <code>imageTitle</code> and <code>caption</code> which are plain text fields. I am able to display <code>imageTitle</code> and <code>caption</code> in my template but not a file, or the image itself. This is my template:</p>
  <pre><code>     {% for image in block.imageWithCaption %}
          &lt;div class=&quot;large-4 columns&quot;&gt;
            &lt;div class=&quot;media-object stack-for-small&quot;&gt;
              &lt;div class=&quot;media-object-section&quot;&gt;
                &lt;div&gt;
                  &lt;img src=&quot;{{ image.file }}&quot; alt=&quot;&quot;&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class=&quot;media-object-section&quot;&gt;
                &lt;h6&gt;{{ image.title }}&lt;/h6&gt;
                &lt;p&gt;{{ image.caption }}&lt;/p&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        {% endfor %}
  </code></pre>
  <p>I get an error:</p>
  <blockquote>
  <p>Object of class Craft\ElementCriteriaModel could not be converted to
  string</p>
  </blockquote>
  <p>What I am doing wrong and how can I display the image?</p>
  
Tags: <assets><matrix><plugin-neo>
Title: Neo plugin - Displaying an image from a Matrix field
ThreadText: # Neo plugin - Displaying an image from a Matrix field
  
  (Asked by: username_0 on 2017-06-01)
  
  I am using the [Neo](https://github.com/benjamminf/craft-neo/wiki) plugin in my project. I have made a Neofield `article content` with several block types in it. Amongst the block types that I have in it, is a `gallery` as well. Gallery block type has a`matrix` field `imageWithCaption`, and the field `imageWithCaption` has fields `file` which is the assets field, and fields `imageTitle` and `caption` which are plain text fields. I am able to display `imageTitle` and `caption` in my template but not a file, or the image itself. This is my template:
  
  ```
       {% for image in block.imageWithCaption %}
          <div class="large-4 columns">
            <div class="media-object stack-for-small">
              <div class="media-object-section">
                <div>
                  <img src="{{ image.file }}" alt="">
                </div>
              </div>
              <div class="media-object-section">
                <h6>{{ image.title }}</h6>
                <p>{{ image.caption }}</p>
              </div>
            </div>
          </div>
        {% endfor %}
  
  ```
  
  I get an error:
  
  > Object of class Craft\ElementCriteriaModel could not be converted to
  > string
  
  What I am doing wrong and how can I display the image?
  
  **Tags:** assets, matrix, plugin-neo
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-06-01. Score: 3 | Accepted answer
  
  It's tough to see the full context, just based on what you have here. From what I can tell, it seems like you might need to change `<img src="{{ image.file }}" alt="">` to `<img src="{{ image.file.first().url }}" alt="">`.
  
  Since the asset field can hold many assets, you have to declare `.first()` to grab the first one -- even if there's only one image. Then you have to grab the `url` property from the image, in order to get the correct `src` value.
  
  
  ---
  
  