The Twitter widget displays an embedded Twitter tweet, video, or timeline in a Marfeelized mobile site.

Implementation Details

Gutenberg spots the class of the Twitter embed:

  • tweet (.twitter-tweet)
  • video (.twitter-video)
  • timeline (.twitter-timeline)

Gutenberg then transforms it to the Marfeel version with the respective classname:

mrf-twitterTweet
mrf-twitterVideo
mrf-twitterTimeline
CODE

When these classes are found inside an article, the Twitter platform code (platform.twitter.com/widgets.js) is run in order to replace the elements with their embed representation.

Activation code snippet

Implementation is included in the Marfeel core and no extra code is needed. It should run automatically on demos as well.

Considerations

  • A querySelectorAll must be run on every article change, in order to find the Twitter widget.
  • Sometimes the publisher changes the code of the Twitter embed or uses old implementations.
  • In most cases the publisher doesn't need to change anything.

Usage example

http://bc.marfeel.com/bolavip.com/189242/domingo-14-de-agosto-de-argentinos-en-los-juegos-olimpicos-de-rio-de-janeiro