My Image field seems to be empty when I do <%# Eval("Image") %>.
It was REALLY complicated, but I finalliy get this to work with another Transformation and the code below :
<%@ Register Src="~/CMSModules/Content/Controls/Attachments/DocumentAttachments/DocumentAttachments.ascx" TagName="DocumentAttachments" TagPrefix="cms" %>
<script runat="server">
protected override void OnInit(EventArgs e)
{
CMS.DataEngine.DataClassInfo dci = CMS.DataEngine.DataClassInfoProvider.GetDataClassInfo(Eval("ClassName").ToString(), true);
if (dci != null)
{
CMS.FormEngine.FormInfo fi = new CMS.FormEngine.FormInfo(dci.ClassFormDefinition);
// field name we added in the page type
CMS.FormEngine.FormFieldInfo ffi = fi.GetFormField("Image");
Guid AttachmentGroupGUID = ffi.Guid;
ucDocAttachments.Path = Eval<string>("NodeAliasPath");
ucDocAttachments.AttachmentGroupGUID = AttachmentGroupGUID;
ucDocAttachments.TransformationName = "CMS.Root.DisplayImage";
ucDocAttachments.ReloadData(true);
}
}
</script>
<%# GetAttachmentIcon("AttachmentGUID") %>
<div>
<div class="img"><cms:DocumentAttachments ID="ucDocAttachments" runat="server" /></div>
<div class="text">
<h2><%# Eval("Title") %></h2>
<%# Eval("Content") %>
</div>
</div>