oveleon/contao-cookiebar

Support for Twitter

FrischBlau opened this issue · 6 comments

Regardless of Twitter-/Mastodon-discussions a support for embedded Twitter timelines would be nice.

Twitter timelines should be able to be integrated as an individual script without any problems.

That was my idea too, but unfortunately it doesn't work. Maybe I'm doing something wrong:
The embed code for Twitter is
<a class="twitter-timeline" href="https://twitter.com/XYZ?ref_src=12345678">Tweets by XYZ</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

On the page where the timeline should be displayed I have included the following part
<a class="twitter-timeline" href="https://twitter.com/XYZ?ref_src=12345678">Tweets by XYZ</a>

And in the cookiebar settings I selected "Custom(Script)" and entered "platform.twitter.com/widgets.js" in "Script(confirmed)" with "async" as Source URL parameter.

The specified source URL always ends up in the HEAD section of the website. It could be that the script also needs to be inserted directly in the body and where the widget is to be embedded. Here I would recommend to work with the addModule method to embed the script in the body.

Thanks for the clue, I tried to adapt the addModule method for this but I´m afraid I´m out at this point.

If you need help, you can hire us for custom installation or sponsor a new Twitter-Timeline Cookie-Token for the community.
https://www.oveleon.de/cookiebar.html#angebot-anfordern

Great, I´ll drop you a line.