Embedding a person’s latest tweets into a tiddler used as a Contact Entry

Using the core Twitter Plugin, a custom Twitter field, and a ‘Person’ tag, this allows you to create a contact card that will automatically show the latest tweets by that person.

Install the Twitter Plugin

It’s a core plugin so you can install it from the core plugin library. Save and reload.

Create an Example Tiddler

Create a new tiddler and give it a title of a person, like “Jeremy Ruston”.

Tag it with ‘Person’ or the tag of your choice to indicate that this will be a Contact.

In the fields section, enter a new field name labelled twitter. For the value, enter in https://twitter.com/Jermolene.

You can write anything you like in the body, or nothing at all. Maybe Creator of [[TiddlyWiki]].

Save and close the Tiddler.

Create a view template

Create a new Tiddler and call it something like “Person Twitter Template”.

Tag it with $:/tags/ViewTemplate

In the body, enter the following:

<$list filter="[all[current]tag[Person]has:field[twitter]]">
<$twitter type="timelineUrl" url={{!!twitter}} tweetLimit=3 />
</$list>

In words: apply this template to all tiddlers that have the tag ‘Person’ and have a twitter field.

Then whatever is in between the list filters is displayed, in this case the standard twitter macro, with the url being pulled from the twitter field. !!is short hand for “field name of current tiddler”.

Save this Tiddler.

Tiddlers now have tweets

Now, when you visit the “Jeremy Ruston” Tiddler or any other Tiddler tagged with ‘Person’, the Twitter macro will be displayed.

Thank you to @Mark_S and everyone else in the Discussion thread.

@Mark_S also points out that view template cascades would be the newer way of doing this.

4 Likes