hi, I am using a custom control in a transformation, below is the code:
<%@ Register Src="~/CMSModules/Content/Controls/Attachments/DocumentAttachments/DocumentAttachments.ascx" TagName="DocumentAttachments" TagPrefix="cms" %> < script> 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); CMS.FormEngine.FormFieldInfo ffiReports = fi.GetFormField("Reports"); CMS.FormEngine.FormFieldInfo ffiFiles = fi.GetFormField("Files"); Guid AttachmentGroupGUIDRep = ffiReports.Guid; Guid AttachmentGroupGUIDRFil = ffiFiles.Guid; ucDocAttachmentReports.Path = Eval<string>("NodeAliasPath"); ucDocAttachmentFiles.Path = Eval<string>("NodeAliasPath"); ucDocAttachmentReports.AttachmentGroupGUID = AttachmentGroupGUIDRep; ucDocAttachmentFiles.AttachmentGroupGUID = AttachmentGroupGUIDRFil; ucDocAttachmentReports.TransformationName = "CMS.Root.AttachmentLinks"; ucDocAttachmentFiles.TransformationName = "CMS.Root.AttachmentLinks"; ucDocAttachmentReports.ReloadData(true); ucDocAttachmentFiles.ReloadData(true); }
}
< /script> <div class="selectedElectionInfo elem-to-hide selectedContent-3"> <cms:DocumentAttachments ID="ucDocAttachmentReports" runat="server" /> </div> <div class="selectedElectionInfo elem-to-hide selectedContent-4"> <cms:DocumentAttachments ID="ucDocAttachmentFiles" runat="server" /> </div>
the code is working fine for only one culture (arabic) and the attachments are showed normally, but for the second culture (english) only the Reports control is showed, but the Files control is empty, with no errors, anyone has an idea what could be the problem?
Have you checked that the attachments exist in the English version? Kentico stores the document culture agains the attachments, so if you add them in the Arabic version of the page, they will not automatically appear in the English versions.
no I added some data, but it didnt show anything, also for the Reports control I didnt have to add any data in english, the reports were shown automatically in both cultures. do you have any idea where should I look to invest?
Are you showing both on the same page? Or do you have 1 page where you want to show all culture versions of this report and attachments?
I dont know if I understood your question, but both reports and files are in the Home page in a separate divs, and the Home page has 2 versions, arabic and english, but they are not shown together simultaneously (if this is your question)
Farah, in the Pages applicaiton, if you change your language to English and look at the page in question, can you see the attachments in the the Properties > Attachments tab?
thanks a lot, it turns out that the data was mistakenly displayed and unordered so thats why when I added some data, I couldnt find it in the correct place.
Please, sign in to be able to submit a new answer.