User Image

Author Message

Rene Sack

Wednesday 10 August 2005 2:54:35 am

Hello. How can I fetch and display the image from the user who is currently logged in? I tried something like this:

{let owner=$node.object.owner owner_map=$owner.data_map}
{section show=$owner_map.image.has_content}
{attribute_view_gui attribute=$owner_map.image image_class=small}
{/section}
{/let}

but this only displays the image from the owner of the node and not from the user who is currently logged in. Can anybody help plz? :-)

Greenvalley is waiting

David Eriksson

Wednesday 10 August 2005 4:49:54 am

If you are in page_layout, you already have the user in $current_user. If you're in a view template, you will have to fetch it first.

{def $user=fetch('user', 'current_user')}
{if $user.data_map.image.has_content}
    {attribute_view_gui attribute=$user.data_map.image image_class=small}
{/if}

/David

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.