Block List Label from Multi Url Picker (Name not displaying)

Hi everyone,

I’m working with Umbraco 15 and trying to use Umbraco Flavored Markdown (UFM) to display a custom label for a Block List item based on a Multi Url Picker field.

:pushpin: What I want to achieve:

In a Block List, I want to set the label to display the name of the selected link from a Multi Url Picker field (url). The picker only allows one link, so I need to extract the name of the first (and only) link.

:magnifying_glass_tilted_left: What I have tried:

According to the official documentation, I have tried:

:one: Basic access to the url field:

{umbValue: url}

Result: [object Object]

:two: Extracting JSON representation:

{umbValue: url | json}
{umbValue: url | stringify}

Result: [object Object] (does not show the structure)

:three: Accessing first item in IEnumerable<Link> (Multi Url Picker returns a collection)

{umbValue: url | first | select:"name"}
{umbValue: url | map:"name" | first}

Result: [object Object]

:four: Direct access to first element:

{umbValue: url[0].name}

Result: (empty)

:five: Parsing JSON if stored as a string:

{umbValue: url | parse-json | first | select:"name"}

Result: [object Object]

:warning: Issue:

It seems UFM cannot correctly process IEnumerable<Link> from a Multi Url Picker in a Block List. Even json does not return a readable string.

:red_question_mark: Question:

:small_blue_diamond: How can I correctly extract and display the name of the first link from a Multi Url Picker field in a Block List label using UFM?

Any insights or workarounds would be greatly appreciated! :raising_hands:

Thanks in advance! :blush:

If you are using v15.1 + then try {umbLink: url}.

(Yup, the documentation needs updating. That’s on me! :person_facepalming:)

2 Likes

That worked perfectly!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.