Jump to content
Daniel.de

Card Layout: Custom image size for desktop and mobile

Recommended Posts

Daniel.de

Hi Alejandro,

I work on some customizations. I try to load different image sizes for desktop and mobile versions in the listing_card_layout_mytheme.thtml.

For the desktop version I use:

$mainMediaThumb = $Media->thumb(Sanitize::getVar($listing,'MainMedia'),['listing'=> &$listing,'size'=>'303x303','mode'=>'scale','return_url'=>true,'thumbnailer'=>'url']);

For Mobile:

$mainMediaThumb = $Media->thumb(Sanitize::getVar($listing,'MainMedia'),['listing'=> &$listing,'size'=>'160x160','mode'=>'scale','return_url'=>true,'thumbnailer'=>'url']);

JReviews is using 640x640. The images in the custom sizes will be loaded if I open the list view page and go to page 2 and back.

Is there a way to load it automatically?

This would be a nice feature, because I can use different image sizes for mobiles which will speed up the page.

Best Regards,

Daniel

Share this post


Link to post
Alejandro

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
Daniel.de

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
Alejandro

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Share this post


Link to post
n00bster
Posted (edited)

This section is only visible with a valid subscription. If you have a valid subscription, please login.

Edited by n00bster

Share this post


Link to post

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Please refer to our Privacy Policy.