Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

User/Groupe Dependent Content

Solved by phi ARCHITECT View solution

Started by Simon Liechti 6 years ago · 1 replies · 733 views
6 years ago

Hi there
I'm looking for a way to show content, which is dependent on the logged user or dependent on his groupe. Is there a possibility to route in different directories after login dependent on the user?

6 years ago Solution

Hi @simonliechti -

To get started - you could add something like this to your template:

TWIG
{% if config.plugins.login.enabled and grav.user.username %}                                       
       Hello {{ grav.user.username }}
{% endif %}

from here you can build the custom content for the user.

👍 1

Suggested topics

Topic Participants Replies Views Activity
General · by themetman, 23 hours ago
2 40 16 hours ago
General · by Hanns Mattes, 1 week ago
0 121 1 week ago
General · by Karmalakas, 1 week ago
2 185 1 week ago
General · by Hanns Mattes, 3 weeks ago
0 235 3 weeks ago
General · by Dima, 4 weeks ago
1 211 4 weeks ago