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
Hi
Umbraco 6.1.6 - Ucomponents 6
A littel help is needed... :-)
I´m struggeling to get the output from the multiurlpicker
Here is what i have, i have been trying to get to work in many ways.
@using umbraco.MacroEngines @inherits DynamicNodeContext @if (Model.AncestorOrSelf("StoreOption").HasValue("urlPicker")) { <p>test0</p> <ul> @foreach (var item in Model.AncestorOrSelf("StoreOption").GetPropertyValue<UrlPickerState>("urlPicker")) { <p>test1</p> @item { <li>test2</li> } } </ul> }
The out put from this is:
It continues until the end of the xml, any sugestions on how to get this to work?
test0
test1
HI
Solved!
This is for umbraco 6.1.6, uComponents6 Multi url picker
This has the property "megamenu3" for the Multi Url Picker on the node "StoreOption"
@{ if (Model.AncestorOrSelf("StoreOption").HasValue("megamenu3")) { <ul class="sub-menu"> @foreach (var urlPicker in Model.AncestorOrSelf("StoreOption").megamenu3.Items) { if (urlPicker != null) { var urlPickerLinkTarget = (urlPicker.NewWindow) ? " target=\"_blank\"" : String.Empty; <li> <a href="@urlPicker.Url" @Html.Raw(urlPickerLinkTarget)>@urlPicker.Title</a> </li> } } </ul> } }
This is for umbraco 6.1.6, uComponents6 url picker
Here the property is "urlPicker"
@if (Model.HasProperty("urlPicker")) { var urlPicker = Model.urlPicker; if (urlPicker != null) { var urlPickerLinkTarget = (@urlPicker.NewWindow) ? " target=\"_blank\"" : String.Empty; <a href="@urlPicker.Url" @Html.Raw(urlPickerLinkTarget)>@urlPicker.Title <i class="icon icon-angle-right"></i></a> } }
Here is more info:
http://our.umbraco.org/projects/backoffice-extensions/ucomponents/questionssuggestions/22766-Retrieve-URL-Picker-data-in-Razor?p=2
http://refreshwebsites.co.uk/blog/get-data-from-ucomponents-multi-url-picker/
This is really handy! I was having the exact same problem.
In my case I'm using the Multi Url Picker to add related products. The products all have a "mainImage" and I was hoping to grab that out rather than just the title of the content item.
Do you know how I might do that with Razor?
Actually I just worked this out. Here is my code for getting the image out of the related content item from the Multi URL Picker.
if(Model.AncestorOrSelf("Product").HasValue("relatedProducts")) { <ul> @foreach (var urlPicker in Model.AncestorOrSelf("Product").relatedProducts.Items) { if(urlPicker != null) { var linkTarget = (urlPicker.NewWindow) ? "target=\"_blank\"" : String.Empty; var nodeId = urlPicker.NodeId; var image = Library.NodeById(nodeId); <li> <a href="@urlPicker.Url" @Html.Raw(linkTarget)> <img src="@image.Media("mainImage","umbracoFile")" /> </a> </li> } } </ul> } }
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
MULTI-URL Picker
Hi
Umbraco 6.1.6 - Ucomponents 6
A littel help is needed... :-)
I´m struggeling to get the output from the multiurlpicker
Here is what i have, i have been trying to get to work in many ways.
The out put from this is:
It continues until the end of the xml, any sugestions on how to get this to work?
test1
<test1
mtest1
utest1
ltest1
ttest1
itest1
-test1
HI
Solved!
This is for umbraco 6.1.6, uComponents6 Multi url picker
This has the property "megamenu3" for the Multi Url Picker on the node "StoreOption"
This is for umbraco 6.1.6, uComponents6 url picker
Here the property is "urlPicker"
Here is more info:
http://our.umbraco.org/projects/backoffice-extensions/ucomponents/questionssuggestions/22766-Retrieve-URL-Picker-data-in-Razor?p=2
http://refreshwebsites.co.uk/blog/get-data-from-ucomponents-multi-url-picker/
This is really handy! I was having the exact same problem.
In my case I'm using the Multi Url Picker to add related products. The products all have a "mainImage" and I was hoping to grab that out rather than just the title of the content item.
Do you know how I might do that with Razor?
Actually I just worked this out. Here is my code for getting the image out of the related content item from the Multi URL Picker.
is working on a reply...