Theme - Load users info

Hi,

First of all… Thanks for the core team behind the Grav and all the developers/community working together with them.

I’m searching some way to return user info from the accounts created in user/accounts/*.yaml

Using

{{ dump(config) }}

i can’t find anything related with accounts folder/info. How can i retrieve the users info?

ps: it’s not the author info from config/sites.yaml

Thanks in advance!
Best regards!

Currently you cannot arbitrarily get to all users from Grav. You can get the current logged in user with {{ dump(grav.user) }} but not all users.

You could however create a plugin that iterated over the .yaml files in the accounts folder, and instantiated user objects for each, then added those to an array which you set as a twig variable.

Then you ‘could’ print all the users. Be careful about security with this approach though. You could potentially expose user data. So maybe strip out sensitive things like encrypted pw.