Answers.Body: <p>Bratvold, what do you mean with "input"? </p>
  
  <p>Actually, if you can get the title of your prev-item, you can get everything of it. </p>
  
  <pre><code>{% if prevEntry %}
    &lt;a class="project" data-type="image" href="{{ prevEntry.url }}"&gt;
      &lt;img
        src="{{ prevEntry.portfolioImage.one().getUrl('progressivePortfolio') }}"
        data-src="{{ prevEntry.portfolioImage.one().getUrl() }}"
      &gt;
      &lt;h3&gt;{{ prevEntry.title }}&lt;/h3&gt;
      &lt;div class="project-client pink bold"&gt;
        {% for row in prevEntry.kunde.all() %}
            {{ row.kundenavn }}
        {% endfor %}
      &lt;/div&gt;
    &lt;/a&gt;
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-26T18:42:11.860Z
Answers.Text: Thanks for the reply! prevEntry worked great for the images but not the other part. This part comes up empty:
  ```{% for row in prevEntry.kunde.all() %}
      {{ row.kundenavn }}
  {% endfor %}
  ```
Answers.UserDisplayName: Stig Melón-Bratvold
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-26T19:53:34.133Z
Answers.Text: What type of field is ``kunde``? Matrix? Table?
Answers.UserDisplayName: RitterKnight
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-27T08:44:22.423Z
Answers.Text: If "kundenavn" is an entries selection field, you need to loop again. 
  
  `{% for entry in row.kundenavn %}{{ entry.title }}{% endfor %}`
Answers.UserDisplayName: Marten Brosch
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-29T19:32:17.020Z
Answers.Text: Thanks @MartenBrosch :)
Answers.UserDisplayName: Stig Melón-Bratvold
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-26T15:09:34.673Z
Answers.LastActivityDate: 2020-05-26T15:09:34.673Z
Answers.UserDisplayName: Marten Brosch
Body: <p>To expand upon <a href="https://craftcms.stackexchange.com/questions/27269/how-to-get-the-previous-or-next-two-entries?answertab=active#tab-top">How to get the previous or next two entries</a> I was wondering how I can also add the image and an input from each entry.</p>
  
  <p>I have simplified the html-structure in this example but essentially what I want to add is:
  entry.portfolioImage.one and row.kundenavn from row in entry.kunde.</p>
  
  <p>The links and entry title is working.</p>
  
  <pre><code>{# Set parameters for prev/next elements list #}
  {% set params = craft.entries.section('portfolio').order('title desc') %}
  
  {# Get the prev/next elements #}
  {% set prevEntry = entry.getPrev(params) %}
  {% set nextEntry = entry.getNext(params) %}
  
  {# And make sure to only output the links if the element exists #}
  {% if prevEntry %}
    &lt;a class="project" data-type="image" href="{{ prevEntry.url }}"&gt;
      &lt;img
        src="{{ entry.portfolioImage.one().getUrl('progressivePortfolio') }}"
        data-src="{{ entry.portfolioImage.one().getUrl() }}"
      &gt;
      &lt;h3&gt;{{ prevEntry.title }}&lt;/h3&gt;
      &lt;div class="project-client pink bold"&gt;
        {% for row in entry.kunde %}
            {{ row.kundenavn }}
        {% endfor %}
      &lt;/div&gt;
    &lt;/a&gt;
  {% endif %}
  {% if nextEntry %}
    &lt;a class="project" data-type="image" href="{{ nextEntry.url }}"&gt;
      &lt;img
        src="{{ entry.portfolioImage.one().getUrl('progressivePortfolio') }}"
        data-src="{{ entry.portfolioImage.one().getUrl() }}"
      &gt;
      &lt;h3&gt;{{ nextEntry.title }}&lt;/h3&gt;
      &lt;div class="project-client pink bold"&gt;
        {% for row in entry.kunde %}
            {{ row.kundenavn }}
        {% endfor %}
      &lt;/div&gt;
    &lt;/a&gt;
  {% endif %}
  </code></pre>
  
Tags: <templating><craft3>
Title: How to get the previous or next two entries with images and
ThreadText: # How to get the previous or next two entries with images and
  
  (Asked by: username_0 on 2020-05-25)
  
  To expand upon [How to get the previous or next two entries](https://craftcms.stackexchange.com/questions/27269/how-to-get-the-previous-or-next-two-entries?answertab=active#tab-top) I was wondering how I can also add the image and an input from each entry.
  
  I have simplified the html-structure in this example but essentially what I want to add is:
  entry.portfolioImage.one and row.kundenavn from row in entry.kunde.
  
  The links and entry title is working.
  
  ```
  {# Set parameters for prev/next elements list #}
  {% set params = craft.entries.section('portfolio').order('title desc') %}
  
  {# Get the prev/next elements #}
  {% set prevEntry = entry.getPrev(params) %}
  {% set nextEntry = entry.getNext(params) %}
  
  {# And make sure to only output the links if the element exists #}
  {% if prevEntry %}
    <a class="project" data-type="image" href="{{ prevEntry.url }}">
      <img
        src="{{ entry.portfolioImage.one().getUrl('progressivePortfolio') }}"
        data-src="{{ entry.portfolioImage.one().getUrl() }}"
      >
      <h3>{{ prevEntry.title }}</h3>
      <div class="project-client pink bold">
        {% for row in entry.kunde %}
            {{ row.kundenavn }}
        {% endfor %}
      </div>
    </a>
  {% endif %}
  {% if nextEntry %}
    <a class="project" data-type="image" href="{{ nextEntry.url }}">
      <img
        src="{{ entry.portfolioImage.one().getUrl('progressivePortfolio') }}"
        data-src="{{ entry.portfolioImage.one().getUrl() }}"
      >
      <h3>{{ nextEntry.title }}</h3>
      <div class="project-client pink bold">
        {% for row in entry.kunde %}
            {{ row.kundenavn }}
        {% endfor %}
      </div>
    </a>
  {% endif %}
  
  ```
  
  **Tags:** templating, craft3
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-05-26. Score: 2 | Accepted answer
  
  Bratvold, what do you mean with "input"?
  
  Actually, if you can get the title of your prev-item, you can get everything of it.
  
  ```
  {% if prevEntry %}
    <a class="project" data-type="image" href="{{ prevEntry.url }}">
      <img
        src="{{ prevEntry.portfolioImage.one().getUrl('progressivePortfolio') }}"
        data-src="{{ prevEntry.portfolioImage.one().getUrl() }}"
      >
      <h3>{{ prevEntry.title }}</h3>
      <div class="project-client pink bold">
        {% for row in prevEntry.kunde.all() %}
            {{ row.kundenavn }}
        {% endfor %}
      </div>
    </a>
  {% endif %}
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks for the reply! prevEntry worked great for the images but not the other part. This part comes up empty: ```{% for row in prevEntry.kunde.all() %}     {{ row.kundenavn }} {% endfor %} ```  
  > **username_2**: What type of field is ``kunde``? Matrix? Table?  
  > **username_1**: If "kundenavn" is an entries selection field, you need to loop again.   `{% for entry in row.kundenavn %}{{ entry.title }}{% endfor %}`  
  > **username_0**: Thanks @username_1 :)  
  
  ---
  
  