Jump to content
RIkard

Is it possible to have the search result show only intro image and not full image

Recommended Posts

Hi

I have installed the Content search pro and updated my default_results.php (I use a yootheme template) so that it fetches an image for me to use in my template and it works very well. Now I wonder if there is a way to only fetch the image if it is an intro image.

Right now if my articles don't have intro images but full article image, that large image is fetched instead. This is of course great most of the time, but I have some large article images that I would rather not fetch during a search if it is possible to avoid it.

I use the Following code: 'image' => isset($result->thumb) ? htmlspecialchars($result->thumb) : ''

Best regards,
Rikard

 

 

Share this post


Link to post
Share on other sites

Hi

Yes, I did that, the images look good, but some items don't have intro images set for a reason and then the full image is used in the search result and that image is sometimes 1920 x 1000px and scaled down to 200x and that can make the rendering slower than it need to be.

Anyway, I commented out the section that fetch the image_fulltext in the contentpro.php

---

/* elseif (!empty($images->image_fulltext)) $article->thumb = $images->image_fulltext;  */

---

So now it works the way I want to, this change will of course be rendered useless after I update the plugin so if there is a smarter way to do this, please enlighten me.

Best regards,
Rikard

Share this post


Link to post
Share on other sites

Nope, there's no other solution besides restoring changes after every plugin upgrade. But I don't update it often, so it won't hurt.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment


×