Hi everyone,
in a template I use the e()
function to check if there is a cover-image set in the panel. If yes, I want to display and crop()
it. Everything works as long as the if-condition is true. But if it’s false, the page breaks. I think it’s because I want to crop an image that isn’t there.
The code looks like this:
e($page->cover()->isNotEmpty(), $page->image($page->cover())->crop(300));
If it’s not correct to use e()
like that, what would the alternative be, checking for a cover-image and showing it cropped?
Thank you,
D