<p><strong>If you are really trying to get the next field in order on an entry type:</strong></p>

<p>Field order can't be set on an entry type's field layout. Craft seems to set their order when you create them in Settings->Fields. Whatever you are trying to setup/accomplish this way I would recommend against.</p>

<p><strong>If you are trying to retrieve entries that the lightswitch field is off:</strong></p>

<pre><code>{% for entry in craft.entries.section('sectionHandle').all().lightSwitchField('not 1') %}
{{ entry.field }}
...
</code></pre>

<p><strong>If you are trying to get the sibling of an entry if the current entry's lightswitch field is off:</strong></p>

<pre><code>{% if not entry.lightswitchField %}
    {% set sibling = craft.entries().nextSiblingOf(entry).one() %}
{% endif %}
</code></pre>

<p>I tried to give you several examples/solutions as your question isn't explicit.</p>

CC BY-SA 4.0
2018-12-18T15:42:45.483Z
2018-12-18T15:42:45.483Z
Chattervast
<p>I'm trying to get the next field in an entry if a passwordRequired Lightswitch Field is switched off.</p>

<p>How would I go about that?</p>

CC BY-SA 4.0
2018-12-15T02:02:49.010Z
What does "next field in an entry" mean? Can you expand one what you're trying to do?
Brad Bell
<previous-next>
Next in structure if lightswitch field off?
# Next in structure if lightswitch field off?

(Asked by: username_0 on 2018-12-14)

I'm trying to get the next field in an entry if a passwordRequired Lightswitch Field is switched off.

How would I go about that?

**Tags:** previous-next
> **Comments:**
> **username_1**: What does "next field in an entry" mean? Can you expand one what you're trying to do?  

---

## 1 answers

### Answer by username_2 on 2018-12-18. Score: 1

If you are really trying to get the next field in order on an entry type:
Field order can't be set on an entry type's field layout. Craft seems to set their order when you create them in Settings->Fields. Whatever you are trying to setup/accomplish this way I would recommend against.
If you are trying to retrieve entries that the lightswitch field is off:
{% for entry in craft.entries.section('sectionHandle').all().lightSwitchField('not 1') %}
{{ entry.field }}
...

If you are trying to get the sibling of an entry if the current entry's lightswitch field is off:
{% if not entry.lightswitchField %}
    {% set sibling = craft.entries().nextSiblingOf(entry).one() %}
{% endif %}

I tried to give you several examples/solutions as your question isn't explicit.


---

