Sometimes you may want to add information or notes or other pieces of text to a tiddler that ideally you don’t want to have displayed/printed with that tiddler. Usually, you’d turn to using a field or sometimes even tag. But both have their limitations. Most fields (apart from title
, text
and tags
) are not part of TiddlyWiki’s standard search mechanism. And you don’t want to create tags just for little notes – too wasteful and it would clutter up the tag space.
Fortunately, there is another way.
Elsewhere (outside of TiddlyWiki) you must have seen sites that use a “tag cloud”. What if you could take that idea but instead of using actual tags, create an area inside your tiddler that isn’t actually visible but still responds to search like it was part of the regular tiddler content: like the title says, a “Searchable, hidden tag cloud”.
First, decide what you want to call your cloud and simply use it as a custom HTML element. For this simple exercise, let’s call it <my-cloud>
…
<my-cloud>
Extra stuff and things about legless sheep that were not mentioned in the main topic.
</my-cloud>
You don’t need to define your custom <my-cloud>
element somewhere, or ask the W3C to add it to the HTML Standard so that you can use it – just go right ahead and use it.
Next, we need to prevent it from appearing in the tiddler when it is viewed…
In your CSS Stylesheet:
my-cloud {
display:none;
}
Or, for more targeted and paranoid coverage…
@media screen, print {
my-cloud {
display:none !important;
}
}
I like to place <my-cloud>
at the end of my tiddler content – it seems less obtrusive down there. You may prefer it at the top, or even in the middle (but that’s a bit weird, don’t you think? Really, you should talk to someone).
Okay, we’re done. Happy hacking!