Jeff VIP
Total posts: 745
01 Oct 2015 04:22

Hi,

I have a records module on the homepage to display just one featured record.

The thumbnail image is too small and I want to replace that with the image from the record page. I don't want to set a larger thumbnail image, say 300px, because that would increase the amount of disk usage in general.

Can I use some code in the template to make this possible?

Best regards, Jeff


klox7 VIP
Total posts: 914
01 Oct 2015 13:15

You can get original image like this (this works for me for image field and image is not resized!!!):

echo '<img src="' . $item->fields_by_id[ID]->value[image] . '">';

If you want to access object info you can always do it like this

echo ‘<pre>’;
var_dump($item->fields_by_id[ID]->value);
echo ‘</pre>’;

But ->value is to get raw field data. Documentation


Jeff VIP
Total posts: 745
01 Oct 2015 16:31

Thanks klox7!

+1


pepperstreet VIP
Total posts: 3,837
01 Oct 2015 21:32

Jeff records module on the homepage to display just one featured record

I remember an older topic, where Sergey mentioned:

" CImgHelper::getThumb() can generate thumbnail of any size."

Can't recall the topic URL, sorry. However the function could create a very specific thumbnail size, if you use it in your custom template in your module.


Jeff VIP
Total posts: 745
01 Oct 2015 23:27

Hi pepperstreet,

you mean: http://www.mintjoomla.com/support/community-forum/item/48-cobalt-8/2151-template-for-records-module-add-possibility-to-choose-image-size-to-use.html ?

Good to know. I used klox7 suggestion with just a little extra css :-)

Powered by Cobalt