When a URL is shared on Facebook, Facebook scrapes the content of that page to extract key elements like the page title, URL, images, and description to populate elements of the Facebook post. To facilitate this process so that it is easier for Facebook to locate the elements it needs when a URL for an individual article is shared from your site, you can enable a feature in Soapbox that automatically generates Facebook Open Graph tags.
With this feature enabled, Soapbox will automatically define the following Facebook Open Graph tags:
- og:title --> The title of your article
- og:type--> "website"
- og:image--> The first image found in your article’s content or a default image you have defined
- og:url--> The URL of the article displayed
- og:description --> The metadata description of the article either as set in the Metadata Information module in the right column of the article's edit view or as automatically generated by Soapbox based on the content of the article, if no metadata description is explicitly defined
- og:site_name --> Your site name
To enable this feature so Facebook Open Graph tags will automatically be generated for individual articles and to define a default image if an article doesn't contain an image:
- Go to Extensions > Plugin Manager
- Open "Content - Facebook OpenGraph"
- For Enabled, choose Yes
- For Default Image in the right column, enter the relative path to an image you have uploaded to the site to use as the default when an article does not contain an image. Example: storage/images/default.png.
- Click Save
To upload an image to Soapbox for use as a default Facebook Open Graph image, go to Site > Media Manager and upload it to the desired directory.