Razor access to Member type Show on member profile value
Hello,
I need to display custom properties of members in frontend, but only those with Show on member profile ticked, and I can't seem to find where to retrieve that value..
This code will show all the member properties that are on the profile:
var profile = Umbraco.MembershipHelper.GetCurrentMemberProfileModel();
if (profile != null)
{
<h3>@profile.Name (@profile.MemberProperties.Count)</h3>
foreach (var prop in profile.MemberProperties)
{
<p>@prop.Name: @prop.Value</p>
}
}
However, for a property to be in the MemberProperties collection you have to tick both "Show on member profile" and "Member can edit" - due to a long standing bug - https://issues.umbraco.org/issue/U4-9443
Razor access to Member type Show on member profile value
Hello,
I need to display custom properties of members in frontend, but only those with Show on member profile ticked, and I can't seem to find where to retrieve that value..
OK, here's how you do it - but there's a caveat:
This code will show all the member properties that are on the profile:
However, for a property to be in the
MemberProperties
collection you have to tick both "Show on member profile" and "Member can edit" - due to a long standing bug - https://issues.umbraco.org/issue/U4-9443is working on a reply...