Problem with MediaPicker in Umbraco 7.6.5. No definition for Url
I have a document node which has a property so user can set the category of the document. This property is a content picker for the node of type category.
Node category has the following properties: Name, Image and Color. Depending on the category selected, the font color changes, name of the category is displayed and the image as well.
I am having some trouble displaying the image, which is a Media Picker.
This is my code:
//Code to get the category
var category = Umbraco.TypedContent(@item.GetPropertyValue<int>("category"));
dynamic node = new umbraco.MacroEngines.DynamicNode(category.Id);
To get the image, I was doing the following:
var categoryImage = node.GetPropertyValue<IPublishedContent>("categoryImage");
The code above returns the following: "umb://media/48d7d9590b7649a39dd60ab4658c152f"
To render the image I tried this:
@categoryImage.Url and @Umbraco.Media(categoryImage).Url
But it returns that string does not contain a definition for Url.
Can someone help me?
var category = Umbraco.TypedContent(@item.GetPropertyValue<int>("category"));
var categoryImage = category.GetPropertyValue<IPublishedContent>("categoryImage");
Problem with MediaPicker in Umbraco 7.6.5. No definition for Url
I have a document node which has a property so user can set the category of the document. This property is a content picker for the node of type category.
Node category has the following properties: Name, Image and Color. Depending on the category selected, the font color changes, name of the category is displayed and the image as well.
I am having some trouble displaying the image, which is a Media Picker.
This is my code:
//Code to get the category
To get the image, I was doing the following:
The code above returns the following: "umb://media/48d7d9590b7649a39dd60ab4658c152f"
To render the image I tried this:
@categoryImage.Url and @Umbraco.Media(categoryImage).Url
But it returns that string does not contain a definition for Url. Can someone help me?
Hi
Would it not just be:
then this should return the URL:
is working on a reply...