I am having an issue with rendering media items newly added to the media section. Below is the macro I am using. It has worked for several months now without issue, I don't think the macro is the problem, but am including it for completeness. This site was freshly copied to a new server including the database which is running on SQL Express. If I pass one of the existing media items (existing prior to site move) I can see it render properly with the umbracoFile path in the html as I would expect. If I point to any files that were added after the move, the html shows empty for the file paths of those media items. I have verified that the media ID values are successfully being passed into the macro.
Any help would be appreciated, thank you.
Macro code
----------------
@using umbraco.MacroEngines @{ var description = @Parameter.description; var marketingContentID = @Parameter.marketingContent; var thumbnailImageID = @Parameter.thumbnailImage; dynamic marketingContent = Library.MediaById(marketingContentID); dynamic thumbnailImage = Library.MediaById(thumbnailImageID); }
media item not rendering on new macro calls
Hello All,
I am having an issue with rendering media items newly added to the media section. Below is the macro I am using. It has worked for several months now without issue, I don't think the macro is the problem, but am including it for completeness. This site was freshly copied to a new server including the database which is running on SQL Express. If I pass one of the existing media items (existing prior to site move) I can see it render properly with the umbracoFile path in the html as I would expect. If I point to any files that were added after the move, the html shows empty for the file paths of those media items. I have verified that the media ID values are successfully being passed into the macro.
Any help would be appreciated, thank you.
Macro code
----------------
@using umbraco.MacroEngines
@{
var description = @Parameter.description;
var marketingContentID = @Parameter.marketingContent;
var thumbnailImageID = @Parameter.thumbnailImage;
dynamic marketingContent = Library.MediaById(marketingContentID);
dynamic thumbnailImage = Library.MediaById(thumbnailImageID);
}
<div class="box"><a href="@marketingContent.umbracoFile"><img src="@thumbnailImage.umbracoFile" alt="" /></a><br />
<h2>Description</h2>
@Html.Raw(description.Replace("\r\n"," "))
</div>
tried to delete this post, but cannot, please ignore.
is working on a reply...