4

I'm using Silverstripe 3.1. The site will have hundreds of users and lots of files / assets.

How can I increase the number of items listed to (from 15 to 50 or so per page) in the admin for both users and files.

Even better if I can just set it by default for all areas of the admin.

Robert
  • 19,800
  • 5
  • 55
  • 85
Legin76
  • 492
  • 3
  • 11

1 Answers1

7

You can do it manually by overloading getCMSFields() and using method $field->setItemsPerPage(50) on grid paginator field.

The other option is to use yaml file. You need create config.yml and put it in _config directory then put in your yaml file:

GridFieldPaginator:
    itemsPerPage: 50

Check also these links:

Robert
  • 19,800
  • 5
  • 55
  • 85
  • Fab thanks.. I've added it to the yaml file... What about the files list? – Legin76 Feb 02 '16 at 11:23
  • 1
    Check what component is responsible for this and do the same. If you read configuration link that I gave you link to then you'd know that you can set any property from any class using convention as above. – Robert Feb 02 '16 at 11:36
  • It took me quite a while to find but I got it... AssetAdmin: page_length: 50 /dev/build is then needed of course. Add that to your answer I'll accept it. Thanks for your help. – Legin76 Feb 02 '16 at 14:02
  • I'm afraid I've got one that I can't work out how to set.. In framework/forms/UploadField.php it has the line below, which is not effected by the above. Obvioulsy I don't want to edit UploadField.php so how would I add that? $config->addComponent(new GridFieldPaginator(8)); – Legin76 Feb 03 '16 at 12:21
  • Uploadfield is not responsible for showing results on grid but for uploading files, I don't understand your question. – Robert Feb 03 '16 at 12:28
  • It's used when you select From files to select files that have already been uploaded. In this case selecting images from a gallery folder. There are about 80 image and only 8 are displayed at a time. Changing $config->addComponent(new GridFieldPaginator(8)); to $config->addComponent(new GridFieldPaginator(20)); works but obviously is bad practice. – Legin76 Feb 03 '16 at 12:34