You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to use Multi Url Picker without models builder. Strongly typed, not dynamic. It would be great to include an example of this on the readme page similar to the below. I am assuming that I can test for data with HasValue() per below?
if (searchItem.HasValue("overviewLinks"))
{
var multiUrlPicker = searchItem.GetPropertyValue<IEnumerable<Link>>("overviewLinks");
if (multiUrlPicker.Any() && multiUrlPicker != null)
{
<ul>
@foreach (var item in multiUrlPicker)
{
<li><a href="@item.Url" target="@item.Target">@item.Name</a></li>
}
</ul>
}
}
The text was updated successfully, but these errors were encountered:
Having a quick look at the source I'm not entirely sure that .HasValue() always works, but .GetValue<IEnumerable<Link>>() should always return a collection (if using v1 or if using v2 and the Max number of items pre value is greater than 1) where you can use multiUrlPicker.Any()
If Max number of items is 1 and you are using v2+ you can use .GetPropertyValue<Link>() and do a null check afterwards
Thanks for your quick response. on 7.12.3 looks like HasValue() is working as far as I can tell. Since most property editors offer this as a universal value presence test, it would be great to ensure that that is in there. This picker is sorely missing in the core of Umbraco and desperately needed. Thanks for making this available!
Trying to use Multi Url Picker without models builder. Strongly typed, not dynamic. It would be great to include an example of this on the readme page similar to the below. I am assuming that I can test for data with HasValue() per below?
The text was updated successfully, but these errors were encountered: