Widget:TwitterTimeline

da Pokémon Central Wiki, l'enciclopedia Pokémon in italiano.
Vai alla navigazione Vai alla ricerca

This widget displays a Twitter Timeline. It is included in a page in this way:

{{#widget: TwitterTimeline | width = 500 | url = https://twitter.com/TwitterDev/timelines/539487832448843776 | theme = dark}}

However, this example is incomplete for the sake of readability. More parameters can be passed, and all of them have sensible defaults, as shown below.

  • color: The hexadecimal value of the color of the links displayed in the widget, without #. Defaults to the twitter brand color, a shade of light blue.
  • lang: The language of the widget, for the text not from the tweets themselves (for example the Tweets by xxx at the top). Defaults to it.
  • loadingText: The text to display before the widget if fully loaded, linking to $url. Defaults to Tweet di pokemoncentral.
  • theme: The theme of the widget, as offered by Twitter. It can be either light or dark. Defaults to light.
  • url: The url to fetch tweets from, without the querystring. Defaults to our Twitter account one, https://twitter.com/pokemoncentral.
  • width: Width of the widget, IN PIXELS, without unit. Defaults to the full width of the parent element.
NOTE: The width is in pixels. Don't complain then if stuff like 100% doesn't work. If you really need non-pixel width, set the desired width on a wrapper and use the default width for this widget.

You might have noticed that height is not a parameter: in fact, the widget spans the full height of its parent. If a specific height is necessary, use the same approach as non-pixel width, that is use a wrapper element and set the height on that.

Here it is the actual content of the widget:

<a class="twitter-timeline" data-lang="" data-width="" data-theme="" data-link-color="#" href="?ref_src=twsrc%5Etfw"></a>

<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>