Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Heosforo Posted March 19, 2016 Posted March 19, 2016 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.
opentype Posted March 22, 2016 Posted March 22, 2016 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.
Heosforo Posted March 22, 2016 Author Posted March 22, 2016 Thanks mate, I remember that this was possible in previous IPB versions. It seems I'll have to upload the images directly
jeece76 Posted March 26, 2016 Posted March 26, 2016 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}}
opentype Posted March 26, 2016 Posted March 26, 2016 That’s great! I just used this to add Twitter Card meta tags to my articles, so sharing the articles will now look much more appealing on Twitter.
Heosforo Posted March 30, 2016 Author Posted March 30, 2016 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?
opentype Posted March 30, 2016 Posted March 30, 2016 The record template used for the specific Pages database.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.