diff --git a/src/flextype/core/Entries/Directives/ExpressionsDirective.php b/src/flextype/core/Entries/Directives/ExpressionsDirective.php index 05ced1af..021ea1d0 100644 --- a/src/flextype/core/Entries/Directives/ExpressionsDirective.php +++ b/src/flextype/core/Entries/Directives/ExpressionsDirective.php @@ -16,6 +16,7 @@ declare(strict_types=1); namespace Flextype\Entries\Directives; +use function Glowy\Strings\strings; use function Flextype\emitter; use function Flextype\entries; use function Flextype\parsers; @@ -24,6 +25,7 @@ use function Flextype\collection; // Directive: [[ ]] [% %] [# #] emitter()->addListener('onEntriesFetchSingleField', static function (): void { + if (! registry()->get('flextype.settings.entries.directives.expressions.enabled')) { return; } @@ -34,6 +36,10 @@ emitter()->addListener('onEntriesFetchSingleField', static function (): void { $field = entries()->registry()->get('methods.fetch.field'); + if (is_string($field['value']) && strings($field['value'])->contains('!expressions')) { + return; + } + $vars = []; // Convert entry fields to vars.