Introducing Quests: Tailored gamification & bridging in-person events with your community Mike Gitkos Friday at 12:39 PM2 days
Posted March 19, 20169 yr 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.
March 22, 20169 yr Community Expert 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. Edited March 22, 20169 yr by opentype
March 22, 20169 yr Author Thanks mate, I remember that this was possible in previous IPB versions. It seems I'll have to upload the images directly
March 26, 20169 yr 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}} Edited March 26, 20169 yr by jeece76
March 26, 20169 yr Community Expert 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. Edited March 26, 20169 yr by opentype
March 30, 20169 yr Author 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.