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
I've been going around in circles with this one, and was hoping someone could assist please.
I am attempting to reference a "thumbnailImage" element on the page that is being selected from a content picker - how do I do this?
Thank you
Hi Warren,
Where are you trying to do this ? Can you tell us a bit more for your setup.
Can you show us some example code of what you have so far.
Dave
Thanks for getting back to me Dave, I'm running Umbraco 10.4 (now, was 10.3 yesterday) and using models mode SourceCodeAuto
I am trying to tackle this in the partial for a block list component , which looks like this currently:
@inherits UmbracoViewPage<BlockListSection> @using Umbraco.Cms.Core.Models; @using Umbraco.Cms.Core.Services; @inject IContentService Services; @{ var content = (MyPublishedModel)Model.Block.Content; var contentService = Services; var udiAsString1 = content.Prev.Udi.ToString(); var guid1 = Guid.ParseExact(udiAsString1.Substring(udiAsString1.Length - 32), "N"); var content1 = contentService.GetById(guid1); var thumbnailImage = content1.Properties["thumbnailImage"].Values; var thumbnailImage2 = content1.Properties["thumbnailImage"].GetValue(); var breakPoint = 1; }
Ideally I would like to access the thumbnail variables as strongly typed MediaWithCrops but I'm not sure how to do that.
Thanks again,
Warren
I might have overcomplicated this by using Umbraco.MultiUrlPicker rather than Umbraco.MultiNodeTreePicker
However, I would be keen to know how to bind the above too if you can please.
Can you post the code for BlockSection and MyPublishedModel ?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Retrieving elements from the target of a content picker
I've been going around in circles with this one, and was hoping someone could assist please.
I am attempting to reference a "thumbnailImage" element on the page that is being selected from a content picker - how do I do this?
Thank you
Hi Warren,
Where are you trying to do this ? Can you tell us a bit more for your setup.
Can you show us some example code of what you have so far.
Dave
Thanks for getting back to me Dave, I'm running Umbraco 10.4 (now, was 10.3 yesterday) and using models mode SourceCodeAuto
I am trying to tackle this in the partial for a block list component , which looks like this currently:
Ideally I would like to access the thumbnail variables as strongly typed MediaWithCrops but I'm not sure how to do that.
Thanks again,
Warren
I might have overcomplicated this by using Umbraco.MultiUrlPicker rather than Umbraco.MultiNodeTreePicker
However, I would be keen to know how to bind the above too if you can please.
Hi Warren,
Can you post the code for BlockSection and MyPublishedModel ?
Dave
is working on a reply...