Facebook Extension

The Facebook embedded plugin is the class responsible for running the Facebook SDK init method when it identifies Facebook posts or Facebook videos in articles. 

Implementation details

The class runs only when Facebook embeds are identified in an article in Marfeel. 

Embeds have the specific class .mrf-embed. When this class runs, it checks if the article contains one of the following classes:

.mrf-facebookPost
.mrf-facebookVideo

If one of the above classes is found, it loads the Facebook SDK and runs the FB.init method.

The rest of the implementation is completed by Facebook which converts the HTML into the respective Facebook embed. 

Activation code snippet

No activation code snippet is required for this embed because it's supported out-of-the-box by Marfeel due to the popularity and common use of Facebook embeds by tenants.

Considerations

An excessive amount of Facebook embeds in a single article may have an adverse impact on performance and delay the rendering of the page. 

Usage example

http://theybf.com/2016/03/08/olympic-gymnast-gabby-douglas-goes-off-on-the-beam-wins-american-cup-alexandra-shipp