To get item name of multi URL picker in variable (...
# help-with-umbraco
s
Hi there, I am selecting a component under generic page Data folder (with multi url picker), component child/types are in dropdown, when clicked to select component in "Link Title" field component name fetched. Now I want to compare this Link Title with my [var styleValue = Model.Value("style")] styleValue variable in partial view. I am unable to retrieve "Link Title" value! @{ var lists = Model.Children(x => x.ContentType.Alias == "list"); var styleValue = Model.Value("style"); } @if (lists != null) { foreach (var list in lists) { var selectedDocument = Umbraco.Content(list.Name); //Need to get "Link Title" from multi url to compare. ^^//This is not working Give me solution? if (styleValue != null && selectedDocument.Name == styleValue) { @**@ @Html.Partial("~/Views/Partials/Lists/list-style-one.cshtml", Model) } ..... } I hope you get my query! [Code is error free]
j
Try var selectedDocument = Umbraco.Content(list.Id);
s
Thanks, Actually I already tried this one too.
s
Umbraco.Content(list.Id)
should work, what was the problem? FYI: you can (and should!) easily format your code on Discord by using three backticks around it, you can even add syntax highlighting: https://techswift.org/2021/07/02/how-to-format-text-as-a-block-snippet-of-code-in-discord/
s
Thanks Sebastian, It was something else it just got done with dropdown datatype property.