Document Attachments Control only displays 10 Attachments Max

Elvis Wohlken asked on October 25, 2014 00:13

I have a regular old page of page-menu-item type(Called 'Exhibits') with child pages of a custom type ('Client' in this case). On the 'Exhibits' page, I have a repeater web part and a Pages Datasource web part whose path is set to select all Client pages that are children of the current page. Then, I apply the custom 'Client.ClientGallery' transformation I created to the repeater, so that I can display each Client pages name, description, and teaser image on the 'Exhibits' Page. Finally, I need to display all of the files attached to each 'Client' subpage within the 'Client.ClientGallery' Transformation. This is where I am running into trouble. I'm using a documentAttachments Control within my 'Client.ClientGallery' Transformation to display the attachments, but for some reason the control only seems to display the top 10 attachments for each of the 'Client' subpages. I need for ALL attachments to be displayed.

Here's the code for my transformation:

<%@ Register Src="~/CMSModules/Content/Controls/Attachments/DocumentAttachments/DocumentAttachments.ascx" TagName="DocumentAttachments" TagPrefix="cms" %>

<div class="client">
  <h6><%# Eval("ClientName") %></h6>
  <p><%# Eval("ClientDescription") %></p>
  <a href="<%# Eval("ClientTeaserImage") %>" rel="<%# Eval("ClientName").ToString().Replace(" ", "_").ToLower() %>_gallery" class="fancybox gallery-link"><img alt="<%# Eval("ClientName") %> Gallery" src="<%# Eval("ClientTeaserImage") %>" /><div class="overlay"><span>Click Here to View Gallery</span></div></a>
  <div class="gallery-images">
    <cms:DocumentAttachments ID="documentAttachments" runat="server" TransformationName="CMS.Root.Attachment" Path='<%# Eval("NodeAliasPath")%>' />
  </div>
</div>

Any help is appreciated, I can't post any links to the current project at the moment but that may change in the future so let me know if more information is necessary and I will do my best to provide it.

Recent Answers


Brenden Kehren answered on October 25, 2014 01:08 (last edited on October 25, 2014 01:08)

I'll bet the paging is set. You could set PageSize="20" and see if it changes at all. If so, then paging is enabled and the pager isn't visible.

0 votesVote for this answer Mark as a Correct answer

andrew c answered on December 12, 2014 11:45

Im having the same issue, but the paging is not set. is this an inbuilt limit to the Document Attachments Control?

0 votesVote for this answer Mark as a Correct answer

Sandro Jankovic answered on December 15, 2014 09:26

Hello,

Could you please try switching the control to ~/CMSModules/Content/Controls/Attachments/DocumentAttachments/DocumentAttachmentsList.ascx which displays 25 attachments by default, but you can set the PageSize="all". This control is used to display the list of attachments on the Form tab. Would this work for you?

Best Regards,

Sandro

0 votesVote for this answer Mark as a Correct answer

andrew c answered on December 15, 2014 17:51

No joy with that Sandro, looks like ill have to go back to the drawing board

0 votesVote for this answer Mark as a Correct answer

Sandro Jankovic answered on December 16, 2014 14:06

Hi Andrew,

What happens when you try the control - do you get an error or is it still limited to 10 attachments? Just to make sure, can you confirm the version/hotfix you are using? I will try to reproduce the issue again in your exact version once I have this information. I will also try to find another solution in case this doesn't work for you.

Best Regards,

Sandro

0 votesVote for this answer Mark as a Correct answer

andrew c answered on December 19, 2014 11:56

Version im running is 8.1.4.

Im using the below code, so when the user click on a hyperlink a fancybox gallery will pop up and display the ten images. Renders like this currently

Image and video hosting by TinyPic

...but when i change the control to a DocumentAttachmentsList it renders like this...

Image and video hosting by TinyPic

...so i dont think its the correct control for the current setup

<%@ Register Src="~/CMSModules/Content/Controls/Attachments/DocumentAttachments/DocumentAttachments.ascx" TagName="DocumentAttachments" TagPrefix="cms" %>

<div class="standard-listing__item fancybox-container">
      <div class="media-element">
          <div class="media-element__image-container">
              <a class="fancybox-alias" href="#">
                  <img class="media-element__image" src="<%# Eval("ListingImage") %>">
              </a>
          </div>
          <div class="media-element__content">
              <h4 class="header-separator"><%# Eval("Title") %></h4>
              <p><%# Eval("ListingText") %></p>
              <div class="fancybox-links-container">
                  <cms:DocumentAttachments AttachmentGroupGUID="C28C976D-C113-48CD-AC54-DAE85BA6B321" ID="documentAttachments" runat="server" TransformationName="tourismireland.marketingactivity.Attachments" Path='<%# Eval("NodeAliasPath") %>'  />
              </div>
          </div>
      </div>
</div>
0 votesVote for this answer Mark as a Correct answer

Sandro Jankovic answered on December 19, 2014 16:19

Hi Andrew,

Thanks for the update - I understand the issue now. Since that control would not work for you, I revisited the control you were originally trying to use. I found that setting the page size in the control does work as expected:

<cms:DocumentAttachments PageSize="50" AttachmentGroupGUID="C28C976D-C113-48CD-AC54-DAE85BA6B321" ID="documentAttachments" runat="server" TransformationName="tourismireland.marketingactivity.Attachments" Path='<%# Eval("NodeAliasPath") %>' />

If you increase the PageSize, you will see more than the default 10. However, I can see that you have specified an AttachmentGroupGUID and I believe that is causing some issues for you. Could you try removing that or navigating to the database CMS_Attachment table and manually checking the AttachmentGroupGUID field to ensure all of the attachments you are trying to show are actually using that GUID? I believe this is what is causing the issue - please let me know what you find.

Thanks!

Best Regards,

Sandro

0 votesVote for this answer Mark as a Correct answer

andrew c answered on December 22, 2014 10:01

Putting the page size attribute in did the job Sandro, thanks very much for the help!

Regards,

Andrew

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.