diff --git a/src/Cms/File.php b/src/Cms/File.php index b91f6ee1c1..d508d03d38 100644 --- a/src/Cms/File.php +++ b/src/Cms/File.php @@ -584,7 +584,7 @@ public function site(): Site */ public function template(): string|null { - return $this->template ??= $this->content()->get('template')->value(); + return $this->template ??= $this->content('default')->get('template')->value(); } /** diff --git a/src/Cms/FileActions.php b/src/Cms/FileActions.php index 712291a6df..536f3c038a 100644 --- a/src/Cms/FileActions.php +++ b/src/Cms/FileActions.php @@ -137,7 +137,10 @@ public function changeTemplate(string|null $template): static $template = null; } - $file = $file->update(['template' => $template]); + $file = $file->update( + ['template' => $template], + 'default' + ); // resize the file if configured by new blueprint $create = $file->blueprint()->create();