Twitter Integration

Creating and using twitter feed in cms page. (Example uses @Twitter feed)

1. Create twitter widget:

Now you will get preview of feed you selected and code to implement. The code should look something like this:

<a class="twitter-timeline" href="https://twitter.com/Twitter">Tweets by Twitter</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Copy that code you will need to add it.

2. Add to CMS:

Note: You will need to add this code in HTML mode (by clicking <>)

3. Add Scripts:

let twitterInclude = document.createElement('script');
twitterInclude.setAttribute('src', 'https://platform.twitter.com/widgets.js');
document.head.appendChild(twitterInclude);

Note: This adds script shown in second line of generated code.

document.body.addEventListener("cmsPageLoaded", function(){
  if (document.querySelector('.twitter-timeline')) {
    window.twttr.widgets.load();
  }
});