rantonse I would divide this into two questions 1. Can I display file count beside each folder name in the menu? and 2. Can I do with with a custom text formatting function? Before I answer this though, it's important you understand the technical requirements to be able to achieve this.
First of all, loading the full menu, which could be 1000's of folders, is a fairly intensive process on server. Often, it could take a few seconds to process, until it gets cached in Files Gallery. Luckily, since we are only requesting folders, it will always work sufficiently fast. However, if we are going to COUNT all files in all folders, we also need to loop through all files in all folders, just to extract the count. This may cause a very slow menu, although it might work sufficiently fast if your server is powerful and/or the root directory is not massive.
By default, Files Gallery will only know the file "count" inside each folder after each folder has been loaded (clicked in the menu). If we want to know the count for all menu items beforehand, we would need to process everything up front.
So just to emphasize, this is actually a relatively very heavy task you are asking for. Also, Files Gallery is a web-application (requests go through the internet), often running on shared servers, and even most desktop file browsers don't offer this feature.
In conclusion, yes it can be done, but it is a very ineffective task.
rantonse It would be great to be able to quickly see if a folder contains 1000 images versus only 1 image.
Of course, Files Gallery wouldn't distinguish between files, images and folders inside the folder. It would count anything in the folder. If you only wanted to list "images", it would need to filter images-only, but this seems way too specific.
Considering all the above, there is a reason "count" features are not built-in by default into the menu and gallery layouts. It can be done, but I would certainly not be able to offer something like 'folder_title' => '%name% [%count%]'
, because it's not like we have the %count%
available in PHP withougt heavy additional processing. The fact is that most "templating" options like you are referring to, are achieved from Javascript, where the count would need to get processed on server/PHP.
- Can I display file count beside each folder name in the menu?
I would say maybe yes, I might consider an option for this. It would be disabled by default, and should only be enabled if you don't have a massive folder structure and/or you have a powerful server.
- Can I do with with a custom text formatting function?
I think no, because this isn't processed in Javascript, and we don't know the count up front.