Forums / Developer / Current user is logged?

Current user is logged?

Author Message

David Santiso

Sunday 23 January 2011 12:03:47 pm

Hi,

If the current user is logged in from any template, what variables I can use to see it?

I've seen that pagelayout template uses

{if $current_user.is_logged_in}

but, for example, the templates that show the content from the nodes, doesn't work.

Thanks,

David

Sylvain Guittard

Sunday 23 January 2011 1:04:36 pm

Hi David,

In the template that show the content of a node, you must use this code:

{def $current_user=fetch( 'user', 'current_user' )}

And then, you can use your code...

Sylvain

http://www.vignevin-epicure.com
http://twitter.com/vignevinEPIcure

David Santiso

Monday 24 January 2011 11:30:21 am

Thank you very much.