How to output an Entries Field value within a Matrix Field block I'm trying to code up a Matrix field for a homepage slider, and it contains a single 'Slide' block type. It has fields for Image (Assets), Heading (Plain Text), Sub-Heading (Plain Text), and Slide Link (Entries). I've got everything working, except for the Slide Link field (where I want to output the entry URI for the entry that was selected in that field).

Whenever I add {{ block.slideLink }} to my template, I get the following error: 


  Object of class Craft\ElementCriteriaModel could not be converted to string


So I'm obviously not meant to output a link to an entry (I only have one link being selected in the field) in this way, so can someone help me out with the syntax that I need please? There weren't any Entries examples in the Matrix Field docs that I could copy from, and I couldn't figure out how to adapt the Entries Field examples to fit in with a Matrix field.

Thanks in advance for any help, and here's my code. The incorrect {{ block.slideLink }} code is on line 11:

{% extends "_layout" %}

{% block content %}

  &lt;div class="grid-100 flexslider"&gt;
    &lt;ul class="slides"&gt;

      {% for block in entry.homepageSlideshow %}

        &lt;li&gt;
          &lt;a href="{{ block.slideLink }}"&gt;

            {% set largeImage = {
              mode: 'crop',
              width: 1180,
              height: 450,
              quality: 80
            } %}

            {% set image = block.image.first() %}
            {% if image %}
              &lt;img src="{{ image.getUrl(largeImage) }}" alt="{{ image.title }}"&gt;
            {% endif %}

            &lt;div class="flex-caption grid-40"&gt;
              &lt;h2&gt;{{ block.heading }}&lt;/h2&gt;
              &lt;p style="font-weight: bold;"&gt;{{ block.subHeading }}&lt;/p&gt;
            &lt;/div&gt;&lt;!-- flex-caption --&gt;

          &lt;/a&gt;
        &lt;/li&gt;
      {% endfor %}
    &lt;/ul&gt;
  &lt;/div&gt;&lt;!-- grid-100 --&gt;

{% endblock %}
You get this error because {{ block.slideLink }} returns an array of EntryModels (even if you set your Entries field up to only allow 1 entry). So you need to add the first() method to get the first (and only) EntryModel that you are interested in:

{% set entry = block.slideLink.first() %}


Access the url property to return the URL of that entry:

{% if entry %}
    {{ entry.url }}
{% endif %}