Jump to content

Setting unique meta images per page?

Featured Replies

Posted

Hi, I'm trying to figure out how to get social media to pull an image unique specific to each custom page .. versus just my site's logo that I specified in my theme's sharer logo setting. 

Tried inserting the meta property tags in the page html - But no luck and apparently those tags must be included in the header only.  So, whats the workaround to make this possible?

  • Community Expert

You can push them to the header from anywhere in the template like so. 

{{\IPS\Output::i()->metaTags['yourMetaTag'] = 'yourContent';}}

 

  • Author

Not sure I'm following.  I used the following code but that didn't work.  What am I doing wrong?  Thanks!

{{\IPS\Output::i()->metaTags['https://www.cruisecrazies.com/members/group-ftlaud.jpg'] = 'https://www.cruisecrazies.com/members/group-ftlaud.jpg';}}

 

  • Community Expert

The first one needs to be the tag itself, e.g. metaTags['og:image']

@opentype I'm also interested in this tip.
How do I get the link from the first image of the post?

  • Author

Worked like a charm thank you!

On 5/11/2018 at 11:18 PM, opentype said:

The first one needs to be the tag itself, e.g. metaTags['og:image']

This is really helpful. I'm trying to set this to be the first embedded/attached image in the first post. Any ideas what template for that?

Thanks!

  • Community Expert

I will make a plugin to achieve this without template edits. Expect it in 1 to 3 days on the Marketplace. ? 

Edited by opentype

On 5/10/2018 at 9:24 PM, JTrollerb123 said:

Hi, I'm trying to figure out how to get social media to pull an image unique specific to each custom page .. versus just my site's logo that I specified in my theme's sharer logo setting. 

Tried inserting the meta property tags in the page html - But no luck and apparently those tags must be included in the header only.  So, whats the workaround to make this possible?

This has been something that I have been fighting for a long time. Add link to your FB page, and it only pulls in the logo and the meta info for that page or for the forum the topic is in that you want to share as well.

@opentype, if I read this correctly, are you creating a plugin that, when attempting to share a link to FB, or other social media outlets, that perhaps the first few text lines of the topic, page, article, etc, along with the first image for example, will populate the FaceBook page posting, instead of a generic sharer logo?

  • Community Expert
On 5/13/2018 at 4:45 PM, JohnCourt said:

 if I read this correctly, are you creating a plugin that, when attempting to share a link to FB, or other social media outlets, that perhaps the first few text lines of the topic, page, article, etc, along with the first image for example, will populate the FaceBook page posting, instead of a generic sharer logo?

Yes. Here it is:

 

16 minutes ago, opentype said:

Yes. Here it is:

 

Brilliant! Thank you!

Purchased it, implemented it, really no implementation, just install it and you're ready to go, thanks Open! Work brilliantly!

Archived

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

Recently Browsing 0

  • No registered users viewing this page.