Back to SiteSearch Support

jimjam51916
jimjam51916

Hi the plugin is great how can I include an image in my search results, each result Id like to have the heading image of the page so it looks a bit nicer and not just text based. Ive Tried to tie in the Thumb nail approach but it does not work

   <h2>Here is what we could find based on your Search results quary "{{ searchResults.query }}" </h2>
   {% component 'searchResults' %}

    <img class="ss-result__image" src={{ result.thumb.getThumb(120, auto) }} alt=""/>

Will this link work if I have the <img src={{ /assets/images/image.png'| thumbnail(500, 'auto') }}> on to a page I am asking to show in the search results page?

everything else is pulling across just not the image URL. or do I need to host the images in the media section.

I have the thumbnail component installed so do i need to do it kind of like this? <img src={{ 'storage/app/media/image.png'|thumbnail(500, 'auto') }}>.

Any help would be great and thank you for making this, Its a very very nice function.

Last updated

OFFLINE
OFFLINE

What type of result are you displaying? A static page? Where does the heading image come from?

jimjam51916
jimjam51916

Yes these are static pages but parts of them have the CMS on them. I can associate some or a thumbnail function to be added to the sections, I just am wondering if I can call the heading images to display on the search results. I do not mind making thumbnails specifically to display on the search

Last updated

OFFLINE
OFFLINE

You have access to the original model in this partial: https://github.com/OFFLINE-GmbH/oc-site-search-plugin/blob/develop/components/searchresults/searchresult.htm

{{ result.model }}

You have access to all available page data using this. As I don't exactly understand your setup I cannot give you a complete code example. But somewhere on this model variable you should find your image.

jimjam51916
jimjam51916

Sorry just saw this yeah ill check it out and see if I can pull the images across no stress

1-5 of 5