Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/bolt/contenttypes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ entries:
image:
type: image
group: media
upload: entries
upload: "{random}/{contenttype}/{date}"
video:
type: embed
relations:
Expand Down
4 changes: 2 additions & 2 deletions src/Twig/HtmlExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public function placeholders(?string $string = null, array $replacements = []):
$baseReplacements = [
'year' => date('Y'),
'month' => date('m'),
'day' => date('D'),
'date' => date('Y-m-D'),
'day' => date('d'),
'date' => date('Y-m-d'),
'random' => bin2hex(random_bytes(4)),
];

Expand Down
2 changes: 1 addition & 1 deletion templates/_partials/fields/file.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% endset %}

{% block field %}
{% set setPath = field.definition.get('upload')|placeholders({'random': 4, 'contenttype': record.contenttype}) %}
{% set setPath = field.definition.get('upload')|placeholders({'contenttype': record.contenttype}) %}
{% set directory = path('bolt_async_upload', {'location': location|default('files'), 'path': setPath}) %}
{% set filelist = path('bolt_async_filelisting', {'location': location|default('files') }) %}
{% set labels = {
Expand Down
2 changes: 1 addition & 1 deletion templates/_partials/fields/filelist.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% endset %}

{% block field %}
{% set setPath = field.definition.get('upload')|placeholders({'random': 4, 'contenttype': record.contenttype}) %}
{% set setPath = field.definition.get('upload')|placeholders({'contenttype': record.contenttype}) %}
{% set directory = path('bolt_async_upload', {'location': location|default('files'), 'path': setPath}) %}
{% set filelist = path('bolt_async_filelisting', {'location': location|default('files') }) %}
{% set labels = {
Expand Down
2 changes: 1 addition & 1 deletion templates/_partials/fields/image.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

{% block field %}

{% set setPath = field.definition.get('upload')|placeholders({'random': 4, 'contenttype': record.contenttype}) %}
{% set setPath = field.definition.get('upload')|placeholders({'contenttype': record.contenttype}) %}
{% set directory = path('bolt_async_upload', {'location': location|default('files'), 'path': setPath}) %}
{% set filelist = path('bolt_async_filelisting', {'location': location|default('files'), 'type': 'images' }) %}
{% set labels = {
Expand Down
2 changes: 1 addition & 1 deletion templates/_partials/fields/imagelist.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% endset %}

{% block field %}
{% set setPath = field.definition.get('upload')|placeholders({'random': 4, 'contenttype': record.contenttype}) %}
{% set setPath = field.definition.get('upload')|placeholders({'contenttype': record.contenttype}) %}
{% set directory = path('bolt_async_upload', {'location': location|default('files'), 'path': setPath}) %}
{% set filelist = path('bolt_async_filelisting', {'location': location|default('files'), 'type': 'images' }) %}
{% set labels = {
Expand Down