#137 Show ad cover photo, Fixed cover photo not showing if it was saved localy.

This commit is contained in:
Diatrex 2019-11-13 11:37:34 +03:00
parent eca3b1c68f
commit 3d825471bc

View File

@ -83,8 +83,14 @@ class AdvsController extends AdminController
$table->setColumns([
'cover_photo' => [
'wrapper' => '<img width="64" src="{value.cover_photo}">',
'value' => ['cover_photo' => 'entry.cover_photo']
'wrapper' => function (EntryInterface $entry, Request $request) {
if (strpos($entry->cover_photo, 'http') === 0) {
$wrapper = '<img width="64" src="'.$entry->cover_photo.'">';
} else {
$wrapper = '<img width="64" src="'.$request->root().$entry->cover_photo.'">';
}
return $wrapper;
},
],
'entry.id',
'name' => [