Closed bilogic closed 3 years ago
Beautiful! Thanks! Is there a built-in way to show the original image in a lightbox when clicked?
@bilogic You need to override the index field.
Ok, got it. Thank you.
@bilogic https://github.com/dmitrybubyakin/nova-medialibrary-field#previewusing
I realized this affects show
page too.. possible to specify based on the page type?
@bilogic You can pass a callback in previewUsing
.
Ok, but how does that help? Let's say in index
, I want to use thumb
conversion, but in show
, I want to use small
conversion.
I can update your examples for you :)
@bilogic Something like this (haven't tested, but should work)
Medialibrary::previewCallback(function ($media) {
return $media->getFullUrl(request()->isIndex() ? 'index-conversion' : 'other-conversion');
})
ok thanks let me work it out and then file a PR
Medialibrary::previewCallback(function ($media) { return $media->getFullUrl(request()->isIndex() ? 'index-conversion' : 'other-conversion'); })
The most important bit ->isIndex()
does not exists. Haha.
@bilogic It doesn't (: You're free to easily implement it https://github.com/dmitrybubyakin/nova-medialibrary-field/blob/master/src/Fields/Medialibrary.php#L349
Anyway thanks, I thought it was a quick and easy one.
Hi,
Is there a way to specify using a thumbnail in
index
, i find that it currently loads the original image. Thank you.