mirror of
https://github.com/getgrav/grav.git
synced 2026-08-29 12:27:23 +02:00
Added support specifying custom attributes to assets in a collection (fixes #3358)
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
# v1.7.17
|
||||
## mm/dd/2021
|
||||
|
||||
1. [](#improved)
|
||||
* Allow to unset an asset attribute by specifying null (ie, `'defer': null`)
|
||||
* Support specifying custom attributes to assets in a collection [Read more](https://learn.getgrav.org/17/themes/asset-manager#collections-with-attributes?target=_blank) [#3358](https://github.com/getgrav/grav/issues/3358)
|
||||
|
||||
# v1.7.16
|
||||
## 06/02/2021
|
||||
|
||||
|
||||
@@ -201,8 +201,12 @@ class Assets extends PropertyObject
|
||||
protected function addType($collection, $type, $asset, $options)
|
||||
{
|
||||
if (is_array($asset)) {
|
||||
foreach ($asset as $a) {
|
||||
$this->addType($collection, $type, $a, $options);
|
||||
foreach ($asset as $index => $location) {
|
||||
if (is_array($location)) {
|
||||
$options = array_replace_recursive([], $options, $location);
|
||||
$location = $index;
|
||||
}
|
||||
$this->addType($collection, $type, $location, $options);
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
||||
Reference in New Issue
Block a user