Show pageOld revisionsBacklinksExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Twitter Integration ====== Creating and using twitter feed in cms page. (Example uses @Twitter feed) **1. Create twitter widget:** * Navigate to [[https://publish.twitter.com/|Widget Creator]] and enter desired twitter page * Select **Embedded Timeline** Now you will get preview of feed you selected and code to implement. The code should look something like this: <code> <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> </code> Copy that code you will need to add it. {{:admin:online-platform-cms:generated-code-twitter.jpg|}} **2. Add to CMS:** * Create or Edit CMS page and add first line from generated code to page content. **Note:** You will need to add this code in HTML mode (by clicking <>) {{:admin:online-platform-cms:add-twitter-code.jpg|}} **3. Add Scripts:** * Navigate to CMS Layout * Add twitter inject <code> let twitterInclude = document.createElement('script'); twitterInclude.setAttribute('src', 'https://platform.twitter.com/widgets.js'); document.head.appendChild(twitterInclude); </code> **Note:** This adds script shown in second line of generated code. * Add event listener to load feed <code> document.body.addEventListener("cmsPageLoaded", function(){ if (document.querySelector('.twitter-timeline')) { window.twttr.widgets.load(); } }); </code> {{:admin:online-platform-cms:updated-scripts.jpg|}} admin/online-platform-cms/twitter-integration.txt Last modified: 2021/03/09 07:08(external edit)