<p>Yes. You need to build a <a href="http://buildwithcraft.com/docs/templating/login-form">frontend login form</a> and then block non logged in users from seeing the entries with something along the lines of this:</p>

<pre><code>{% if craft.session.isLoggedIn %}
    {# put content here #}
{% endif %}
</code></pre>

<p>You can also check if the user belongs to a specific group with <code>isInGroup('groupHandle')</code> <a href="http://buildwithcraft.com/docs/templating/usermodel#isInGroup">(more here)</a></p>

CC BY-SA 3.0
2015-08-10T17:56:11.747Z
You can also use [`{% if currentUser %}`](http://buildwithcraft.com/docs/templating/global-variables#currentUser) , which will return `false` if the user is not logged in.
Lindsey D
CC BY-SA 3.0
2015-08-22T22:03:21.280Z
any difference between this and {% requireLogin %}?
cmcjane
CC BY-SA 3.0
2015-08-23T07:10:34.900Z
`{% requireLogin %}` will redirect you to your `loginPath` if you are not logged in. [More here](http://buildwithcraft.com/docs/templating/requirelogin)
megatrond
CC BY-SA 4.0
2020-04-13T17:42:35.777Z
Something seems to have changed. None of these seem to work anymore in Craft CMS 3.3.16.3 {% if craft.session.isLoggedIn %} or {% if currentUser %} - Mr. Sadface.
Josh Coast
CC BY-SA 4.0
2020-04-13T18:06:39.437Z
`{% if currentUser %}` should definitely still work: https://docs.craftcms.com/v3/dev/global-variables.html#currentuser  There's also the page-wide `{% requireLogin %}` tag, but that probably doesn't prevent the entry from showing up on listing pages.
Sandwich
CC BY-SA 3.0
2015-08-10T17:36:05.400Z
2015-08-10T17:36:05.400Z
megatrond
<p>I want to have a public and private (logged in users) section on the front-end. Is that possible on craft?</p>

<entries>
Is it possible to have entries only visible to logged-in users?
# Is it possible to have entries only visible to logged-in users?

(Asked by: username_0 on 2015-08-10)

I want to have a public and private (logged in users) section on the front-end. Is that possible on craft?

**Tags:** entries

---

## 1 answers

### Answer by username_1 on 2015-08-10. Score: 8

Yes. You need to build a frontend login form and then block non logged in users from seeing the entries with something along the lines of this:
{% if craft.session.isLoggedIn %}
    {# put content here #}
{% endif %}

You can also check if the user belongs to a specific group with isInGroup('groupHandle') (more here)

> **Comments:**
> **username_2**: You can also use [`{% if currentUser %}`](http://buildwithcraft.com/docs/templating/global-variables#currentUser) , which will return `false` if the user is not logged in.  
> **username_3**: any difference between this and {% requireLogin %}?  
> **username_1**: `{% requireLogin %}` will redirect you to your `loginPath` if you are not logged in. [More here](http://buildwithcraft.com/docs/templating/requirelogin)  
> **username_4**: Something seems to have changed. None of these seem to work anymore in Craft CMS 3.3.16.3 {% if craft.session.isLoggedIn %} or {% if currentUser %} - Mr. Sadface.  
> **username_5**: `{% if currentUser %}` should definitely still work: https://docs.craftcms.com/v3/dev/global-variables.html#currentuser  There's also the page-wide `{% requireLogin %}` tag, but that probably doesn't prevent the entry from showing up on listing pages.  

---

