Hi,
Well, the example from Developer’s guide is not intended to display grouped attachments. To achieve this you will need to use following code in your transformation:
<%@ Register Src="~/CMSModules/Content/Controls/Attachments/DocumentAttachments/DocumentAttachments.ascx" TagName="DocumentAttachments" TagPrefix="cms" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
CMS.SettingsProvider.DataClassInfo dci = CMS.SettingsProvider.DataClassInfoProvider.GetDataClass("cms.news");
if (dci != null)
{
CMS.FormEngine.FormInfo fi = new CMS.FormEngine.FormInfo(dci.ClassFormDefinition);
CMS.FormEngine.FormFieldInfo ffi = fi.GetFormField("FieldName");
Guid AttachmentGroupGUID = ffi.Guid;
this.ucAttachments.AttachmentGroupGUID = AttachmentGroupGUID;
this.ucAttachments.CultureCode = CMSContext.CurrentDocumentCulture.CultureCode;
this.ucAttachments.SiteName = CMSContext.CurrentSiteName;
this.ucAttachments.ReloadData(true);
}
}
</script>
Please do not forget to replace
cms.news with the name of appropriate document type and
FieldName with the name of field that you are using to store files.
Best regards,
Michal Legen