Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
So all I am trying to get is the Urls from my picker.
This is the code I am using, but I get an error.
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{ var page = Umbraco.Content(2055); } <div id="footer" role="contentinfo"> <div id="colophon"> <div id="footer_nav"> <ul> @{foreach (var link in page.footLinks) { <li><a href="@link.url" @Html.Raw(link.newwindow == "True" ? "target=\"_blank\"" : "")>@link.linktitle</a></li> } } </ul> </div> @page.footNote </div> </div>
This is the error I get:
Cannot implicitly convert type 'uComponents.DataTypes.MultiUrlPicker.Dto.MultiUrlPickerState' to 'System.Collections.IEnumerable'. An explicit conversion exists (are you missing a cast?)
Any ideas?
Update...
so I updated my foreach as such:
@{foreach (var link in page.UrlPicker.footLinks)
Error now goes away but urls are not iterated.
Hi Philip,
Try this:
@{ foreach (var link in page.footLinks.Items) { var urlPickerLinkTarget = (link.NewWindow) ? "_blank" : null; <li><a href="@link.Url" class="@urlPickerLinkTarget">@link.Title</a></li> } }
Jeavon
Oops, little mistake, should be:
@{ foreach (var link in page.footLinks.Items) { var urlPickerLinkTarget = (link.NewWindow) ? "_blank" : null; <li><a href="@link.Url" target="@urlPickerLinkTarget">@link.Title</a></li> } }
Could not find documentation that stated .Items for iterating, but worked flawlessly!
As always Mr. Leopold, you are a gentleman and a scholar!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
uComponents Multi-Url Picker issues v6.1.6 - Partial View
So all I am trying to get is the Urls from my picker.
This is the code I am using, but I get an error.
This is the error I get:
Any ideas?
Update...
so I updated my foreach as such:
Error now goes away but urls are not iterated.
Hi Philip,
Try this:
Jeavon
Oops, little mistake, should be:
Could not find documentation that stated .Items for iterating, but worked flawlessly!
As always Mr. Leopold, you are a gentleman and a scholar!
is working on a reply...