I'm migrating a client from Magento 1 to 2 and I've uploaded all of their images and photos to /pub/media in two separate folders.
I can see these folders when using the wysiwyg editor and select an image, but the images appear in a random sequence rather than alphabetically. Is there a way of chnaging the sort order of the media library elements?
Hello @jgd1955
Please follow the below steps:
setOrder( 'mtime', \Magento\Framework\Data\Collection::SORT_ORDER_ASC )
I hope it helps.
Thanks
I checked the file and can see the string )->setOrder('mtime',\Magento\Framework\Data\Collection:ORT_ORDER_ASC);
within the following section at line 317
/**
* Return files
*
* @param string $path Parent directory path
* @param string $type Type of storage, e.g. image, media etc.
* @return \Magento\Framework\Data\Collection\Filesystem
*/
I guess I've got to add that string in another section?