Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

{% if config.plugins.login.enabled and grav.user.username %} not working

Started by Eric C. 8 years ago · 3 replies · 817 views
8 years ago

Has anyone else noticed that {% if config.plugins.login.enabled and grav.user.username %} has stopped working? I've tried using {{dump(grav.user)}} and looking at the debugger but even though I'm logged in it shows:

JS
Grav\Common\User\User {#105
  #gettersVariable: "items"
  #items: array:5 [
    "username" => ""
    "state" => "enabled"
    "authenticated" => false
    "authorized" => false
    "language" => "en"
  ]
last edited 07/03/18 by Eric C.
8 years ago

Have not noticed this, well spotted.

Are you able to submit this as a bug report on Github? I just described this process on another thread if you are not familiar.

Doing that will get the attention of developers better than here and hopefully it will be resolved sooner.

8 years ago

In my case it was a difference between login in the admin and login in the frontend...
I closed the issue as it is working now as expected, you have to login to site frontend to use the grav.user.username variable.

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 193 2 months ago
Themes & Styling · by Ian, 2 months ago
3 90 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 449 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 44 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 123 3 months ago