I have a similar situation. I added a "Caption" property to the Image mediaType. However, I can't get the caption out. If I have theCaption = "Hello" it all works.
@inherits umbraco.MacroEngines.DynamicNodeContext @using Eksponent.CropUp; @using DigibizAdvancedMediaPicker; @{ if (Model.galleryImages.Any) { <div class="gallery"> @foreach(dynamic image in Model.galleryImages){ var theThumbCrop = CropUp.GetUrl(image.File, new ImageSizeArguments { Width = 100, Height = 100, CropAlias = "thumbnail" }); var theFullCrop = CropUp.GetUrl(image.File, new ImageSizeArguments { Width = 800, Height = 600, CropAlias = "galleryMax" }); var theCaption = image.caption; <a href="@theFullCrop" rel="gallery1" class="fancybox" title="@theCaption"><img src="@theThumbCrop" width="100" height="100" alt="@theCaption"></a> } </div> } }
DAMP and value of custom property
Hey,
This is properly very easy to do but I can't get custom properties from my image.
My custom field in the image datatype is called Description. How can I show the value of that field?
My code so far:
Umbraco 6.0.3
Best regards
Kim
Hello,
Did you try the following?
Jeroen
Hi Jeroen,
Yes, but it didn't work :(
Am I doing it wrong?:
Usually the alias doesn't have a capital so try item.description.
Jeroen
Thank you very much - that did the trick!
Best regards
Kim
I have a similar situation. I added a "Caption" property to the Image mediaType. However, I can't get the caption out. If I have theCaption = "Hello" it all works.
DAMP 2.5 Umb V6.0.3
Cheers,
Craig
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.