Jump to content

Pages: Image sharer with external link


Heosforo

Recommended Posts

Posted

Hello.

I'm using Pages, but instead of the "Record Image" field, I use an external image for each article.
The problem comes when I share the link on facebook, the image doesn't appear.

Is there any way to make this work? My external images are from imgur.com

Appreciate any help.

Posted

There are no settings or very simple code changes to achieve this.

Of course you are free to hire a developer to write a plugin to override the default og:image with your external images. 

Posted

You can do this by adding this code at the top of your template :

{{if ( $record->customFieldDisplayByKey('your_field_name') )}}
{{\IPS\Output::i()->metaTags['og:image'] = (string) \IPS\File::get( 'cms_Records', $record->customFieldDisplayByKey('your_field_name') )->url;}}
{{endif}}

 

Posted
On 26-03-2016 at 5:00 AM, jeece76 said:

You can do this by adding this code at the top of your template :


{{if ( $record->customFieldDisplayByKey('your_field_name') )}}
{{\IPS\Output::i()->metaTags['og:image'] = (string) \IPS\File::get( 'cms_Records', $record->customFieldDisplayByKey('your_field_name') )->url;}}
{{endif}}

 

Hello, thanks for your help.
Please could you tell me where to edit?, globalTemplate, record, or which template?

Archived

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

  • Recently Browsing   0 members

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