Answers.Body: <p>They'll all work except for the last one:</p>
  
  <pre><code>entry.fieldHandle.one()
  entry.fieldHandle.all()
  entry.fieldHandle.count()
  entry.fieldHandle | length
  entry.fieldHandle.exists()
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-20T15:23:32.490Z
Answers.LastActivityDate: 2019-05-20T15:23:32.490Z
Answers.UserDisplayName: Brad Bell
Body: <p>Which one of the following is the correct of way of checking if an element field like images, entries or category is not empty?</p>
  
  <ol>
  <li>{% if entry.fieldHandle.one() %}</li>
  <li>{% if entry.fieldHandle.all() %}</li>
  <li>{% if entry.fieldHandle.count() %}</li>
  <li>{% if entry.fieldHandle | length %}</li>
  <li>{% if entry.fieldHandle.exists() %}</li>
  <li>{% if entry.fieldHandle %}</li>
  </ol>
  
Tags: <craft3>
Title: How to check for an non empty element field?
ThreadText: # How to check for an non empty element field?
  
  (Asked by: username_0 on 2019-05-18)
  
  Which one of the following is the correct of way of checking if an element field like images, entries or category is not empty?
  
  1. {% if entry.fieldHandle.one() %}
  2. {% if entry.fieldHandle.all() %}
  3. {% if entry.fieldHandle.count() %}
  4. {% if entry.fieldHandle | length %}
  5. {% if entry.fieldHandle.exists() %}
  6. {% if entry.fieldHandle %}
  
  **Tags:** craft3
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-05-20. Score: 2
  
  They'll all work except for the last one:
  
  ```
  entry.fieldHandle.one()
  entry.fieldHandle.all()
  entry.fieldHandle.count()
  entry.fieldHandle | length
  entry.fieldHandle.exists()
  
  ```
  
  
  ---
  
  