This page is part of a static HTML representation of the TiddlyWiki at https://tiddlywiki.com/dev/

Undefined widget tutorial

2nd February 2019 at 2:56pm

Let's start be defining a minimal widget which does nothing. It doesn't support any attributes, no child elements, and it doesn't output anything. The name of the widget will be donothing. If it does nothing, then how can we verify after writing the code that we accomplished anything? Well, let's see what happens when an undefined widget is referenced.

[ { "title": "$:/DefaultTiddlers", "text": "[[Undefined widget]]" } ] [ { "title": "Undefined widget", "text": "\n```\n<$donothing/>\n```\n\nRenders as:\n\n<$donothing/>\n" } ]

Since we haven't written the code, the attempt to render the widget gives an undefined widget error. So we will know the donothing code accomplishes something if we don't get the undefined widget error when rendering.