Hello,
I’m trying to crop an Image that exists in a module called “event_info” (module plugin) but the cropping does not return the right path to the generated image in the thumb directory.
This is the path where the call to crop happens:
//localhost:8080/mypage/app/speeches/speech_category/
And this is the path where my picture files exists.
//localhost:8080/mypage/app/speeches/speech_category/some_event/event-info
If I try to use something like this:
$speeches = $page->children()->visible();
<?php foreach ($speeches as $speech): ?>
// get the module 'event-info' from $page
<?php $event_info = $speech->find('event-info'); ?>
<img src="<?php echo $event_info->event_image()->crop(300, 200, 80)->url() ?>" />
<?php endforeach ?>
Where $event_info
is the $page
object of the some_event/event-info
module
this is what gets returned into the src attribute:
<img src="//localhost:8080/mypage/app/pic08.jpg" alt="">
Which is not the right path. What can I use here so I always get the appropriate thumb directory path?
Thanks
Andreas
edit: also the thumbnail doesn’t seem to get generated