i did find out that hotlinked images only work if they were in the first post. i assume this is designed for article thread types. but if it is not much complicated, it would be nice if hotlinked images are treated on par with attached images so they can get picked from any of the posts on that thread page?
Yep, article threads, along with the other new 'type' threads in XF 2.2, are a bit of a bump for now until I have a chance to rethink how it's done.
For those who may not be familiar with XF, think of the "thread" object to be a header container that has the thread info like the title, date, and poster. The actual text of that that thread, including the first post of the thread, are all "post" detail objects. What that means in English is if you only have the "thread" object then you can grab the title & other details but if you want to grab any data, like attachments, then you need all of the corresponding "post" objects that are associated to the thread object. In short, the standard "thread" views are done via a template that exposes both the thread header container and all of the posts details objects at the same time so it's pretty easy to loop through the posts to find the first available attachment. The new type threads, like Article, on the other hand only exposes the thread object. The 'cover_image' function is PHP code that specifically looks for the attachment or linked image within the first post of the thread.
So with that said normal threads will still work as expected because the template has access to both the thread and post objects but at the moment 'article' threads & other types can only use the 'cover_image' option because the template doesn't have access to the post objects.
What's the solution? I need to create some new code sort of like the 'cover_image' function but that loops through all of the posts of the thread. It adds a layer of complexity because currently it's really simple to grab the attachments from standard threads using just a template modification and now we'll have to add some code to be executed instead.
So for anybody using the new 'article' type threads in XF 2.2+, the temporary solution is to turn on both options (
OG:Image use Post Attachment and use Twitter Card
&
OG:IMAGE fallback to XF Article Cover image
). It's not perfect but it should suffice for now. If you have the image proxy option turned on then you should add your own domain to the whitelist (the
Image proxy bypass
option), otherwise your remote hotlinked images will have the proxied URL instead of the real URL.