var tagsList = iMember.GetValue<IEnumerable<string>>("dBwFAthleteTags");
if (tagsList.Any())
{
@tagsList.Count()
<ul>
@foreach (var tag in tagsList)
{
<li>@tag</li>
}
</ul>
}
var memberTyped = Umbraco.TypedMember(Int32.Parse(Model.AthleteMemberPicker.ToString()));
var tags = memberTyped.GetPropertyValue<IEnumerable<string>>("dBwFAthleteTags");
Tags on member
Hello, i am having som difficulty showing tags from the tags data type.
I have a member with tags datatype with now 2 tags: "Talent" and "EYC"
I get the member from the current page with following code:
And then i am trying to show the tags attached to this member with following code:
But on the screen it shows following:
It gives me each tag but it keeps the [" " " "] characters. How can i show them without these characters. And only show the tags value?
hi Christian
I think you have to use GetValue<>
Thanks, Alex
Hi Alex,
Thanks for the reply!
I have tried this, now it says "A value cannot be null" at the line "if (tagsList.Any())"
if i print out: "var tagsList = iMember.GetValue<>
If i print out: "iMember.GetValue("dBwFAthleteTags").ToString()" it gives me: "["Talent","EYC"]"
What Umbraco version are you using?
It is version 7.14.0
Hi Christian
What if we use UmbracoHelper:
Thanks,
Alex
Hi Alex,
That worked! Thanks a lot for your help!
Regards Christian.
is working on a reply...