mirror of
https://github.com/getgrav/grav.git
synced 2026-02-05 06:10:13 +01:00
Flex collection and object now fall back to the default template if template file doesn't exist
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
* Made `UserCollectionInderface` to extend `Countable` to get the count of existing users
|
||||
1. [](#improved)
|
||||
* Flex admin: added default search options for flex objects
|
||||
* Flex collection and object now fall back to the default template if template file doesn't exist
|
||||
1. [](#bugfix)
|
||||
* Fixed `$grav['route']` from being modified when the route instance gets modified
|
||||
* Fixed Assets options array mixed with standalone priority [#2477](https://github.com/getgrav/grav/issues/2477)
|
||||
|
||||
@@ -490,7 +490,12 @@ class FlexCollection extends ObjectCollection implements FlexCollectionInterface
|
||||
$twig = $grav['twig'];
|
||||
|
||||
try {
|
||||
return $twig->twig()->resolveTemplate(["flex-objects/layouts/{$this->getFlexType()}/collection/{$layout}.html.twig"]);
|
||||
return $twig->twig()->resolveTemplate(
|
||||
[
|
||||
"flex-objects/layouts/{$this->getFlexType()}/collection/{$layout}.html.twig",
|
||||
"flex-objects/layouts/_default/collection/{$layout}.html.twig"
|
||||
]
|
||||
);
|
||||
} catch (LoaderError $e) {
|
||||
/** @var Debugger $debugger */
|
||||
$debugger = Grav::instance()['debugger'];
|
||||
|
||||
@@ -819,7 +819,12 @@ class FlexObject implements FlexObjectInterface, FlexAuthorizeInterface
|
||||
$twig = $grav['twig'];
|
||||
|
||||
try {
|
||||
return $twig->twig()->resolveTemplate(["flex-objects/layouts/{$this->getFlexType()}/object/{$layout}.html.twig"]);
|
||||
return $twig->twig()->resolveTemplate(
|
||||
[
|
||||
"flex-objects/layouts/{$this->getFlexType()}/object/{$layout}.html.twig",
|
||||
"flex-objects/layouts/_default/object/{$layout}.html.twig"
|
||||
]
|
||||
);
|
||||
} catch (LoaderError $e) {
|
||||
/** @var Debugger $debugger */
|
||||
$debugger = Grav::instance()['debugger'];
|
||||
|
||||
Reference in New Issue
Block a user