How can I display my own image in the RadzenGravatar Component? I want to change this line in the MainLayout.razor:
@Security.User?.Name
@((!string.IsNullOrEmpty(Security.User?.FirstName) && !string.IsNullOrEmpty(Security.User?.LastName)) ? $"{Security.User?.FirstName} {Security.User?.LastName}" : Security.User?.Name)
<RadzenGravatar Email="@((!string.IsNullOrEmpty(Security.User?.FirstName) && !string.IsNullOrEmpty(Security.User?.LastName)) ? $"{Security.User?.FirstName} {Security.User?.LastName}" : Security.User?.Name)" />
I have already added the columns to the AspNetUser Table
Hi @FastTrak,
Yes, you can use whatever you want in the Template of RadzenProfiileMenu. Here is how to use an image: Finishing touches | Radzen Blazor Studio
here is how I do it.
<RadzenColumn Size="4" SizeSM="8">
<RadzenStack AlignItems="AlignItems.Center" Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.End" Gap="2rem" Style="vertical-align: middle">
<RadzenAppearanceToggle ButtonStyle="Radzen.ButtonStyle.Dark" ToggleButtonStyle="Radzen.ButtonStyle.Dark" ToggleShade="Radzen.Shade.Light" Variant="Radzen.Variant.Flat" Style="background-color: var(--rz-base-900)" />
<RadzenProfileMenu Visible="@Security.IsAuthenticated()" Click="ProfileMenuClick" Style="vertical-align: text-top; margin-top: -5px; height: 50px">
<ChildContent>
<RadzenProfileMenuItem Path="profile" Icon="settings" Text="Profile" />
<RadzenProfileMenuItem Path="application-users" Icon="person" Text="Users" />
<RadzenProfileMenuItem Path="application-roles" Icon="security" Text="Roles" />
<RadzenProfileMenuItem Text="Logout" Value="Logout" Icon="power_settings_new" />
</ChildContent>
<Template>
<RadzenLabel Text="@Security.User.FirstName" Style="font-weight: 600; color: var(--rz-white)" />
<RadzenLabel Text="@Security.User.LastName" Style="font-weight: 600; padding-right: 10px; color: var(--rz-white)" />
<RadzenImage Path="@Security.User.Picture" style="background-color: var(--rz-primary-darker); height: 50px; border-radius: 10px; width: 50px; border: 2px solid #1b1c20; margin-top: -5px" />
</Template>
</RadzenProfileMenu>
@if (!Security.IsAuthenticated())
{
<RadzenButton Text=""
Icon="login"
Click="@SignInClick"
ButtonStyle="Radzen.ButtonStyle.Secondary"
Size="Radzen.ButtonSize.Medium"
IconStyle="IconStyle.Medium"
Class="rz-button-md rz-font-semibold" Shade="Radzen.Shade.Darker" IconColor="white" Style="background-color: var(--rz-base-900)" />
}
</RadzenStack>
</RadzenColumn>