#help-with-umbraco
[SOLVED] Backoffice: in Block list, show image name in label
j

jacksorjacksor (Richard Jackson)

09/25/2023, 10:05 AM
Happy Monday! In the backoffice (v10) I have a block list editor with image rows. That image row has an Image Media Picker, with the alias "image". I would like to show the name of that image in the block list editor's label for that row. I have tried label values such as
Image: {{ image.name }}
and
Image: {{ image }}
but to no joy. Fields such as "caption" can be accessed happily though
{{ caption }}
, the problem arises because
image
is an Umbraco.MediaPicker3 and I'm trying to access the name of that specific piece of picked media (3). I have scoured @Joe Glombek 's EXCELLENT [blog post](https://joe.gl/ombek/blog/umbraco-angularjs-filter-cheat-sheet) but alas I am without results. Please do consider helping a boy out on a cold, autumnal Monday morning. TIA!
j

Joe Glombek

09/25/2023, 10:05 AM
I'm sure there's a filter you neeed
Does
{{ image | ncNodeName }}
do it?
j

jacksorjacksor (Richard Jackson)

09/25/2023, 10:07 AM
No, sadly (I did try that one too earlier, ty)
j

Joe Glombek

09/25/2023, 10:08 AM
🤔
j

jacksorjacksor (Richard Jackson)

09/25/2023, 10:08 AM
Got one other idea, two secs
j

Joe Glombek

09/25/2023, 10:08 AM
What's the raw value?
{{ image | json}}
j

jacksorjacksor (Richard Jackson)

09/25/2023, 10:10 AM
Image: [{"key":"2b56c886-7046-49b1-a808-db429bbdf6b8","mediaKey":"40e86aa7-61f5-41d4-8cd3-9f1b4650f599","crops":[],"focalPoint":null}]
j

Joe Glombek

09/25/2023, 10:10 AM
Ah, its probably because its an array
image[0].name
or
image[0] | ncNodeName
?
j

jacksorjacksor (Richard Jackson)

09/25/2023, 10:11 AM
OH ok. Two secs
j

Joe Glombek

09/25/2023, 10:18 AM
Let me know how you get on and I'll update the blog post
j

jacksorjacksor (Richard Jackson)

09/25/2023, 10:29 AM
Yeah just running into random issues - will absolutely update you when I've got something worth sharing!
@Joe Glombek No joy BUT a heads-up that your link - "source code for the Umbraco filters can be found on GitHub" is now broken. I believe the new link should be this: https://github.com/umbraco/Umbraco-CMS/tree/contrib/src/Umbraco.Web.UI.Client/src/common/filters
(I did not break your link)
j

jacksorjacksor (Richard Jackson)

09/25/2023, 10:58 AM
It's certainly a start:
j

Joe Glombek

09/25/2023, 11:00 AM
I dont think it's a start in the right direction though 😂
I'm so sure I've done this before, I just cant think where!
Hmm, on my blog i'm just using ncNodeName
But thats a v2 media picker
j

jacksorjacksor (Richard Jackson)

09/25/2023, 11:06 AM
OK - cheers mate, I'll come back to this in time. Thanks for your help!
j

Joe Glombek

09/25/2023, 11:09 AM
🤮
{{ "umb://media/" + image[0].mediaKey | ncNodeName }}
Might be worth raising a GitHub issue for this one, @jacksorjacksor (Richard Jackson)!
j

jacksorjacksor (Richard Jackson)

09/25/2023, 11:17 AM
AHHH damnit - yep that works.
HUGE apologies, swear I'd read exactly that page. Also nice to have learned about the nested ( getMediaItem ).Property usage.
But yes, for me that becomes
{{(image[0].mediaKey | mediaItemResolver).name}}
THANK YOU
a

adi_yaish

09/28/2023, 7:16 AM
hello, need help with Block List. how can i find block inside blockList from ipublishContent ? im using umbraco 10
j

Joe Glombek

10/06/2023, 6:59 AM
Probably best to start a new thread with your question @adi_yaish . This one is already solved!
1981 Views