diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 5e16296..f07d268 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -77,7 +77,9 @@ final class BackendController extends Controller implements DashboardElementInte $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/News/Theme/Backend/dashboard-news'); - $news = NewsArticleMapper::getNewest(5); + $news = NewsArticleMapper::withConditional('language', $response->getHeader()->getL11n()->getLanguage()) + ::getNewest(5); + $view->addData('news', $news); return $view; diff --git a/Theme/Backend/dashboard-news.tpl.php b/Theme/Backend/dashboard-news.tpl.php index 06b746c..e748236 100644 --- a/Theme/Backend/dashboard-news.tpl.php +++ b/Theme/Backend/dashboard-news.tpl.php @@ -16,12 +16,12 @@ declare(strict_types=1); * @var \phpOMS\Views\View $this */ -$newsList = $this->getData('news'); +$newsList = $this->getData('news') ?? []; ?>