Jump to content

Specify Facebook og:image inline


Recommended Posts

Hey Guys,

so I am having a bit of a problem at the moment as I'd like to specify an image that i am using inline a certain database record as the og:image meta thingy for facebook.

IPS supports to have the record image to be the og:image meta tag in the header by default, but this is not what I need right now.

Unfortunately Facebook only crawls within the header for og:image meta tags so an inline meta tag is getting ignored.

Do you guys have a good idea on how to approach this issue?



Link to comment
Share on other sites

1 hour ago, opentype said:

You can push it to the header from the template. 

{{\IPS\Output::i()->metaTags['og:image'] = $your_URL;}}


thank you!

Is there a documentation on all the functions like this?

I guess this will only work within templates though... if i upload an inline image like this one:


and want to make THIS image the og:image, how would I do that?

Link to comment
Share on other sites

4 hours ago, opentype said:

Yeah, you do it in the template. You can create a new database field and only if something is uploaded for that field, you push the content out as OG:image. That’s a clean solution. I use that all the time. 

Ah sweet, never thought about doing it this way. Only downside is server storage space I guess 🙂

Thanks for helping out!

Link to comment
Share on other sites

11 minutes ago, opentype said:

Just for the sake of completeness: all of that is of course only done if there are good reasons why you don’t want to use the Record Image. That field is specifically made to upload an image to represent the record and setting it as og:image is a default feature in 4.x. 

The record image serves a different purpose in the current scenario, I will most certainly keep this in mind!

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...