var categories = Model.Content.HasProperty("categoryList") && Model.Content.HasValue("categoryList") ?
Model.Content.GetPropertyValue<ArchetypeModel>("categoryList")
.Fieldsets.Where(x => x != null && x.Properties.Any())
.Select(fs => new
{
Subcategory = fs.GetValue<string>("subcategory"),
ProductList = fs.HasValue("productLink") ?
fs.GetValue<ArchetypeModel>("productLink")
.Fieldsets.Where(x => x != null && x.Properties.Any())
.Select(fs2 => new
{
Title = fs2.GetValue<string>("title"),
SubTitle = fs2.GetValue<string>("subTitle"),
Body = fs2.GetValue<string>("body"),
InternalLink = Umbraco.Url(Umbraco.GetIdForUdi(Udi.Parse(fs2.GetValue<string>("internalLink")))),
ExternalLink = fs2.GetValue<string>("externalLink"),
Image = Umbraco.TypedMedia(fs2.GetValue<IPublishedContent>("image")),
Url = fs2.GetValue<IPublishedContent>("image"),
Url1 = fs2.GetValue<IPublishedContent>("image"),
}) :
null
}) :
null;
I have tried every possible way to get the url of the media picker which has pick multiple items disabled.
with the URL property selected about i get the id of the content, but i am not able to get the url using Umbraco.Media or (fs2.GetValue
So for some strange reason, Url1 was an IPublishedContentType
but it would not print the url if i did Url1.Url
so i wrote a helper class and passed Url1 as a parameter to my helper and in my helper i took the same passed parameter and returned as Url1.Url and that worked.
I still cant figure out why it wouldnt access any of the IPublishedContent Type properties in Razor code.
need help with retrieving url from media picker
Hello, here is my code:
I have tried every possible way to get the url of the media picker which has pick multiple items disabled. with the URL property selected about i get the id of the content, but i am not able to get the url using Umbraco.Media or (fs2.GetValue
So for some strange reason, Url1 was an IPublishedContentType but it would not print the url if i did Url1.Url so i wrote a helper class and passed Url1 as a parameter to my helper and in my helper i took the same passed parameter and returned as Url1.Url and that worked. I still cant figure out why it wouldnt access any of the IPublishedContent Type properties in Razor code.
is working on a reply...