Skip to main content

Get meta images from page object?

Liquid allows you to get feature images and attachments via the page object. Is there also a way to get the "thumbnail image for Facebook?"

ie, and image like this one:

http://d3n8a8pro7vhmx.cloudfront.net/richir/pages/144/meta_images/medium/G200x200.jpg

added to the page via an admin url like this: /pages/144/share

Official response from

The meta images from page object that are available can be found in the documentation here. The meta image is what is uploaded under the page Settings > Social Media, and is the thumbnail that is used when the page is shared on Facebook. The variables are:

 

has_meta_image?

meta_image_url

meta_image_medium_url

meta_image_large_url

 

For example, if you wanted to display the meta image for a blog post, you would use 

{{ post.meta_image_url }} like:

<div class="wrapper">
<ul>
{% for post in page.blog.most_recent_blog_posts limit:10 %}
<li>

<a href="{{ post.url }}"><img src="{{ post.meta_image_url }}" width="X" height="X"></a>

<a href="{{ post.url }}">{{ post.headline }}</a>

</li>
{% endfor %}

</ul>
</div>

You would add in your own styling to make it look as you wanted, but this would display all of the meta images in the forloop. It is the same method described here.

Share this post

Showing 7 reactions

How would you tag this suggestion?
Please check your e-mail for a link to activate your account.