I am having an issue with my media elements. We added a 'caption' property to the image MediaType.
We are using a multiline textbox NOT the RTE for the property. We are haivng issues that, if the textbox is left empty, the string output is umbraco.MacroEngines.DynamicXml.
Why would this be happening. There are not spaces, returns or anything in these boxes.
I have tried multiple ways to check for empty or null and they all still output the same string output if left empty.
Same thing is happening in our AltTag property, if left blank it outputs the umbraco.MarcroEngines.dynamicXml
My code is below. Any suggestions would be greatly appreciated. We are on Umbraco 4.9.1
@using umbraco.MacroEngines @inherits umbraco.MacroEngines.DynamicNodeContext @*BUGGY IN IE - V2 IS HERE BUT AM CURRENTLY USING 1.8*@ @*USING FLEX SLIDER*@ @{ string node = @PageData[0]; if(!String.IsNullOrWhiteSpace(node)){ var mediaFolder = Library.MediaById(node); <div class="generalMediaContainer"> <div class="generalFlexslider-container"> <div class="generalFlexslider"> <ul class="slides"> @foreach(dynamic slideImage in mediaFolder.Children){ if(slideImage.imageName.GetType() != typeof(umbraco.MacroEngines.DynamicXml)) { var slideCaption = @slideImage.caption.ToString(); <li> <img src="/imagegen.ashx?width=500&image=@slideImage.Url" title="@slideImage.caption" alt="@slideImage.altTag" data-caption="#@slideImage.Id" /> @*<img src="@slideImage.umbracoFile" title="@slideImage.caption" alt="@slideImage.altTag" data-caption="#@slideImage.Id" />*@ @if(!String.IsNullOrEmpty(@slideCaption)){ <p class="flex-caption" id="@slideImage.Id">Caption:@slideCaption</p> }else{ } @* @if(@slideImage.HasValue("caption")){ <p class="flex-caption" id="@slideImage.Id">@slideImage.caption</p> } *@ </li> } } </ul> </div> </div> <img class="loadingImg" src="/media/119203/ajax-loader-edit.gif" /> </div> } }