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
Anyone that can help me with this.
I'm trying to get all the links from a "Related links" picker with Leblender. I have this code right now, just to see the output.
My View:
@inherits UmbracoViewPage<Lecoati.LeBlender.Extension.Models.LeBlenderModel> if (Model.Items.Any()) { foreach (var item in Model.Items) { @item.GetValue("footerlink") } }
The output I get is: but is a string?
[ { "caption":"facebook", "link":"http://facebook.dk", "newWindow":true, "edit":false, "isInternal":false, "type":"external", "title":"facebook" }, { "caption":"google", "link":"http://google.dk", "newWindow":false, "edit":false, "isInternal":false, "type":"external", "title":"google" } ]
Nevermind :) got it:
@inherits UmbracoViewPage<Lecoati.LeBlender.Extension.Models.LeBlenderModel> @using Umbraco.Web.Models @if (Model.Items.Any()) { var multiUrlPicker = Model.Items.First().GetValue<RelatedLinks>("footerlink"); if (Enumerable.Any(multiUrlPicker)) { <ul> @foreach (var item in multiUrlPicker) { var linkTarget = (item.NewWindow) ? "_blank" : null; <li><a href="@item.Link" target="@linkTarget">@item.Caption</a></li> } </ul> }
}
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Leblender get Related links.
Anyone that can help me with this.
I'm trying to get all the links from a "Related links" picker with Leblender. I have this code right now, just to see the output.
My View:
The output I get is: but is a string?
Nevermind :) got it:
}
is working on a reply...