Download the PHP package beechit/default-upload-folder without Composer
On this page you can find all versions of the php package beechit/default-upload-folder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download beechit/default-upload-folder
More information about beechit/default-upload-folder
Files in beechit/default-upload-folder
Package default-upload-folder
Short Description Make it possible to configure the default upload folder for a certain TCA column
License GPL-2.0+
Informations about the package default-upload-folder
Default upload folder
Make it possible to configure the default upload folder for a certain TCA column
How to use:
- Download from TER or require (
composer require beechit/default-upload-folder
) extension default_upload_folder - Install extension default_upload_folder via the extension manager
- Create the default folders or the folder is automatically created (Editors needs access to storage and the folder root)
- Add configuration to pageTs
FAQ
What happens when the editor does not have access to the upload folder?
The "Select & upload files" and "Add media by URL" buttons are not available for the editor
How do the fallbacks work?
- First it will check if there is a default upload folder for the table & field combination.
- Then it will check if there is a default upload folder for the table.
- Finally, it will check if there is configuration for
defaultForAllTables
Are folders automatically created?
Yes, but only if path set with combined identifiers like 1:myNewsPicturesFolder
How to use the year/month/week/day feature?
- Make sure the variable
tx_mews_domain_model_news
has thedateformat
value set to1
.- Then (over)write the original variable however you prefer:
tx_news_domain_model_news = 1:news/{Y}/{m}
- This will translate into:
1:news/2023/06
which in turn creates the directory:news/2023/06
Why does the year/month/week/day feature not use the php strftime function & format?
The strftime function has been deprecated in PHP 8.1, and will be removed in PHP 9.
Currently, there is no proper solution that takes localisation in consideration. Hence, the choice to create a custom interpreter. The values used are based on the date() -> Parameter Values format. the values currently in use are:
- Y - A four digit representation of a year
- y - A two digit representation of a year
- m - A numeric representation of a month (from 01 to 12)
- n - A numeric representation of a month, without leading zeros (1 to 12)
- d - The day of the month (from 01 to 31)
- j - The day of the month without leading zeros (1 to 31)
- W - The ISO-8601 week number of year (weeks starting on Monday)
- w - A numeric representation of the day (0 for Sunday, 6 for Saturday)
The other values are currently not in use.
This functionality might be refactored in the future when php offers a proper replacement to the removal of
strftime
.
Requirements:
TYPO3 V12.4
Changes TYPO3 V12:
Converted from Hook to Event, as Hooks are depricated.
Added Services.yaml (as required for Event handling) Now receives $backendUserAuthentication directly from $GLOBALS['BE_USER'].