<p>I ran into the same problem where if a page was 'disabled', I didn't want it to show in my footer navigation. The recommended answer didn't work for me. The link still showed up. The following worked:</p>

<pre><code>{% set myEntry = craft.entries.id(entryId).first() %}

{% if myEntry %}
    &lt;li&gt;&lt;a href="example.com"&gt;Example&lt;/a&gt;&lt;/li&gt;
{% endif %}
</code></pre>

CC BY-SA 3.0
2018-02-16T17:40:56.647Z
2018-02-16T17:40:56.647Z
Jeff Irwin
<p>You can check the status of an entry with <code>.status</code>. <a href="https://craftcms.com/docs/templating/craft.entries#status" rel="noreferrer">https://craftcms.com/docs/templating/craft.entries#status</a></p>

<p>This code should work!</p>

<pre><code>{% set jobsEntry = craft.entries.id(jobsId) %}

{% if jobsEntry.status == 'live' %}
    &lt;a href="{{ jobsEntry.url }}"&gt;Jobs&lt;/a&gt;
{% else  %}
    Jobs is disabled
{% endif %}
</code></pre>

CC BY-SA 3.0
2017-11-03T18:17:21.987Z
Thanks! The code definitely works, but my link still shows even though I disabled the entry. And the page still shows up even though the entry's status is disabled. I thought marking it as 'disabled' would at least not let it show in the browser.
kingkelly
CC BY-SA 3.0
2017-11-05T11:22:24.377Z
That sounds strange – when you specifically ask only for entries that are `live`, it shouldn't show entries that are `disabled`. Do you have any active caching going on?
KSP
CC BY-SA 3.0
2017-11-03T17:27:38.250Z
2017-11-03T17:27:38.250Z
Jake Dohm
<p>I'd like to show a 'Jobs' link in my navigation only if the Jobs page is enabled. Is there a way for craft to detect if the page is enabled, and show a div?</p>

<conditional><status>
If page is enabled, show div
# If page is enabled, show div

(Asked by: username_0 on 2017-11-03)

I'd like to show a 'Jobs' link in my navigation only if the Jobs page is enabled. Is there a way for craft to detect if the page is enabled, and show a div?

**Tags:** conditional, status


---

## 2 answers

### Answer by username_2 on 2017-11-03. Score: 6 | Accepted answer

You can check the status of an entry with .status. https://craftcms.com/docs/templating/craft.entries#status
This code should work!
{% set jobsEntry = craft.entries.id(jobsId) %}

{% if jobsEntry.status == 'live' %}
    Jobs
{% else  %}
    Jobs is disabled
{% endif %}

> **Comments:**
> **username_0**: Thanks! The code definitely works, but my link still shows even though I disabled the entry. And the page still shows up even though the entry's status is disabled. I thought marking it as 'disabled' would at least not let it show in the browser.  
> **username_3**: That sounds strange – when you specifically ask only for entries that are `live`, it shouldn't show entries that are `disabled`. Do you have any active caching going on?  

---

### Answer by username_1 on 2018-02-16. Score: 2

I ran into the same problem where if a page was 'disabled', I didn't want it to show in my footer navigation. The recommended answer didn't work for me. The link still showed up. The following worked:
{% set myEntry = craft.entries.id(entryId).first() %}

{% if myEntry %}
    Example
{% endif %}


---

