From 2b2300da8e95d311e88e9b2938df2ecc61ce08b0 Mon Sep 17 00:00:00 2001 From: Sebastian Fey Date: Mon, 7 Dec 2020 11:29:38 +0100 Subject: [PATCH] Added lazy-loading images also to categories and tags Signed-off-by: Sebastian Fey --- lib/Controller/MainController.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/Controller/MainController.php b/lib/Controller/MainController.php index d6884f560..8b0df907b 100755 --- a/lib/Controller/MainController.php +++ b/lib/Controller/MainController.php @@ -180,6 +180,13 @@ public function category($category) { 't' => $this->service->getRecipeMTime($recipe['recipe_id']) ] ); + $recipes[$i]['imagePlaceholderUrl'] = $this->urlGenerator->linkToRoute( + 'cookbook.recipe.image', + [ + 'id' => $recipe['recipe_id'], + 'size' => 'thumb16' + ] + ); } return new DataResponse($recipes, Http::STATUS_OK, ['Content-Type' => 'application/json']); @@ -207,6 +214,13 @@ public function tags($keywords) { 't' => $this->service->getRecipeMTime($recipe['recipe_id']) ] ); + $recipes[$i]['imagePlaceholderUrl'] = $this->urlGenerator->linkToRoute( + 'cookbook.recipe.image', + [ + 'id' => $recipe['recipe_id'], + 'size' => 'thumb16' + ] + ); } return new DataResponse($recipes, Http::STATUS_OK, ['Content-Type' => 'application/json']);