diff --git a/administrator/components/com_templates/src/Controller/TemplateController.php b/administrator/components/com_templates/src/Controller/TemplateController.php index 619aaa6b65f2f..34285fe96bea2 100644 --- a/administrator/components/com_templates/src/Controller/TemplateController.php +++ b/administrator/components/com_templates/src/Controller/TemplateController.php @@ -80,6 +80,12 @@ public function close() $id = (int) $this->input->get('id', 0, 'int'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file . '&isMedia=' . $this->input->getInt('isMedia', 0); + + // If the file was opened from the Updated Files tab, redirect back there. + if ($this->input->getCmd('return', '') === 'updated_files') { + $url .= '#files'; + } + $this->setRedirect(Route::_($url, false)); } @@ -360,6 +366,12 @@ public function save() $file = base64_encode('home'); $id = (int) $this->input->get('id', 0, 'int'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file . '&isMedia=' . $this->input->getInt('isMedia', 0); + + // If the file was opened from the Updated Files tab, redirect back there. + if ($this->input->getCmd('return', '') === 'updated_files') { + $url .= '#files'; + } + $this->setRedirect(Route::_($url, false)); break; } diff --git a/administrator/components/com_templates/tmpl/template/default.php b/administrator/components/com_templates/tmpl/template/default.php index 1467d9d7f532a..fbacd0724dbd9 100644 --- a/administrator/components/com_templates/tmpl/template/default.php +++ b/administrator/components/com_templates/tmpl/template/default.php @@ -123,6 +123,9 @@