Skip to content

User Twig functions

ibexa_user_get_current()

ibexa_user_get_current() returns the User object (Ibexa\Contracts\Core\Repository\Values\User\User) of the current user.

1
{{ ibexa_user_get_current().login }}

You can get the underlying content item, for example to display the user's last name, by accessing the content property:

1
{{ ibexa_render_field(ibexa_user_get_current().content, 'last_name') }}

ibexa_current_user()

ibexa_current_user() is a deprecated alias of ibexa_user_get_current().

ibexa_is_current_user()

The ibexa_is_current_user() Twig function checks whether a user is the current repository user.

Examples

1
2
3
{% if ibexa_is_current_user(version_info.author) %}
    <!-- Display edit link -->
{% endif %}