Is it possible to auto-height to see the full image?
- Posted by loren1 (2) Offline
i use minifrontpage
Is it possible to auto-height to see the full image?
If so, what should I do?
Thank you.
2 years 10 months ago #1
by loren1
Is it possible to auto-height to see the full image?
If so, what should I do?
Thank you.
Please Log in or Create an account to join the conversation.
- Posted by TemplatePlazza (5261) Offline
Hi, the thumbnail is generated in the same size you defined in the module parameters page. Can you elaborate what do you mean by auto height
2 years 10 months ago #2
by TemplatePlazza
Please Log in or Create an account to join the conversation.
- Posted by loren1 (2) Offline
- Posted by TemplatePlazza (5261) Offline
It will need some code changes, but if you know how to code, you can do that via template override then change the part that generate the thumbnail
into something like this
You might still need some html and css tuning but basically the idea is mentioned above.
2 years 10 months ago #4
by TemplatePlazza
$thumb_img = MinifrontpageHelper::getThumbnail($item->id, $item->images,$thumb_folder,$show_default_thumb,$custom_default_thumb,$thumb_width,$thumb_height,$item->title,$item->introtext.$item->fulltext,$module->id);
into something like this
$images = json_decode($article_images);
// Find Article's Image
if (!empty($images->image_intro) ) {
$thumb_img = $images->image_intro;
} elseif (empty($images->image_intro) && !empty($images->image_fulltext) ) {
$thumb_img = $images->image_fulltext;
} else {
// Find first image in the article
$html = $introtext;
$pattern = '/<img .*?src="([^"]+)"/si';
if ( preg_match($pattern, $html, $match) ) {
$thumb_img = $match[1];
} else {
$thumb_img = "";
}
}
You might still need some html and css tuning but basically the idea is mentioned above.
Please Log in or Create an account to join the conversation.