diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 5e798df..9fabebc 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -59,7 +59,7 @@ final class BackendController extends Controller implements DashboardElementInte $view->setTemplate('/Modules/News/Theme/Backend/news-dashboard'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000601001, $request, $response)); - $mapperQuery = NewsArticleMapper::getAll() + $mapperQuery = NewsArticleMapper::getAll() ->with('createdBy') ->with('tags') ->with('tags/title') @@ -122,7 +122,9 @@ final class BackendController extends Controller implements DashboardElementInte ->where('publish', new \DateTime('now'), '<=') ->where('language', $response->getLanguage()) ->where('tags/title/language', $response->getLanguage()) - ->limit(5)->sort('publish', OrderType::DESC)->execute(); + ->where('id', 0, '>') + ->limit(5) + ->execute(); $view->addData('news', $news); diff --git a/Theme/Backend/dashboard-news.tpl.php b/Theme/Backend/dashboard-news.tpl.php index 7e99f37..dab27ef 100755 --- a/Theme/Backend/dashboard-news.tpl.php +++ b/Theme/Backend/dashboard-news.tpl.php @@ -12,6 +12,9 @@ */ declare(strict_types=1); +use Modules\News\Models\NewsType; +use phpOMS\Uri\UriFactory; + /** * @var \phpOMS\Views\View $this */ @@ -28,16 +31,19 @@ $newsList = $this->getData('news') ?? [];