Blog images in search results

Heather16
Tourist
4 0 1

Hello, 

I have been trying to find the answer to this for a few hours now and I'm throwing in the towel and coming to the forums. Previously when we were on Wordpress and I was able to do it.. How can you you get the images in your blogs to show in search results? I am looking to have the full res, 600x600px display with the article text. How can this be done? Example, if you search Color of the Week on our site.. We are looking to have the images display on all blogs and blog posts.

Thank you!

0 Likes
Gwen_Beloti
Tourist
42 0 1

I have the same question.  I added a search box to my blog sidebar and limited the results to "articles" only and that works great, however the results page doesn't render the image that is associated with the articles, simly the title alongside a gray image of a circle with a line through it.

Is it possible for the article images to display along with the titles? If not can that gray default image be removed??

Thanks for any input.

0 Likes
Hitsthings
New Member
2 0 0

So 3 months and no response at all. No "It's easy, here's how". No "we're looking into that". Not even a "sorry we've prioritized other work".

0 Likes
Jason
Shopify Expert
10360 158 2011

So 3 months and no response at all.

Posts do get missed. With the search results you would know if the search item was a product, page or article. So if it's an article, and you've have added an image into the description just use some basic liquid filtering and grab the image out. This will give you the basic idea.

{% if article.content contains "<img" %}
    {% assign src = article.content | split: 'src="' %}
    {% assign src = src[1] | split: '"' | first | replace: '//cdn', 'http://cdn';; | replace: 'http:http://';;, 'http://';; | remove: 'https:' %}
{% endif %}

The image src is {{ src }}.

 

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
Hitsthings
New Member
2 0 0

Now that is slick!! Thanks so much!

0 Likes
Heather16
Tourist
4 0 1

I am relatively new to Shopify and I've been trying to put this into my code for hours and it isn't working... Where does it go? Heh... I feel silly for asking. I'm new to this code so that doesn't help but I'd appreciate it if someone could help us out with it. 

I also have another issue with our Search not populating product results properly but that's another issue. 

 

Thank you!

0 Likes
RuthVaughan
New Member
2 0 0

I'm having same issue! 

0 Likes
RuthVaughan
New Member
2 0 0

If we are unsure of how to do this coding ourselves... is the best option..reach out to Shopify expert?

0 Likes