XF 1.5 Dynamic images for Twitter cards

NinaMcI

Active member
Hi,

I'm trying to add meta tags so that when a post is tweeted, any image that may be attached to the post is inserted as the image in the Summary Card.

This is what I have:

Code:
<meta name="twitter:description" content="{xen:raw $description}">
<meta name=”twitter:url” content=”{xen:raw $url}“>
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@myname">
<meta name="twitter:creator" content="@myname">
<meta name="twitter:title" content="{xen:raw $title}">

This just picks up my avatar as the image.

What meta tag should I use to get the post's image attachment to be used?

<meta name="twitter:image" content="{xen:raw $???}">

Thanks
 
If you only need attachments, you can use to this one as a reference: https://xenforo.com/community/threa...humbnail-for-facebook-feed.18284/#post-237150
If you need embedded images as well, you can try this add-on: https://xenforo.com/community/resources/facebook-opengraph-image-from-img-or-attach-tags.2209/ although I'm not sure whether it still works on XenForo 1.5 (you'll need to modify it for Twitter Cards, obviously)
Otherwise I'm selling a paid alternative over here: https://xenforo.com/community/resources/endless-horizon-advanced-open-graph.5182/ (with built-in Twitter Card support)
 
If you only need attachments, you can use to this one as a reference: https://xenforo.com/community/threa...humbnail-for-facebook-feed.18284/#post-237150
If you need embedded images as well, you can try this add-on: https://xenforo.com/community/resources/facebook-opengraph-image-from-img-or-attach-tags.2209/ although I'm not sure whether it still works on XenForo 1.5 (you'll need to modify it for Twitter Cards, obviously)
Otherwise I'm selling a paid alternative over here: https://xenforo.com/community/resources/endless-horizon-advanced-open-graph.5182/ (with built-in Twitter Card support)
Thank you very much - I'll take a look at the various links.
 
Top Bottom