Virtual tiddlers

Has anyone implemented something like virtual tiddlers? That is, I would like to be able to display a tiddler that doesn’t exist, but can be created from a template and extracting a number from its title to use for configuration. I haven’t worked out navigation or bookmarking, and perhaps those would be difficult, but I need the basics first.

This is for a just-for-fun project I described in Unusual layout: is it possible?. I would like to display Bingo Cards with terms drawn from a list of horrible corporate jargon, for example: Card 4. In the current version the terms for a card are hard-coded in a few named tiddlers, but I don’t want to do that for a thousand cards. Still, I would like for the cards to be fixed, so that if I visit Card 4 again, I would get the same terms.

I know how to do all of this, using a repeatable pseudo-random number generator and using the card number as its seed. What I am less sure of is how to deal with these as virtual tiddlers.

Has anyone worked with something similar?


(Perhaps the techniques @Springer uses to show content for missing tiddlers would be useful. I’ll have to find them again.)

The following reply was maked as a SOLUTION Virtual tiddlers - #3 by Springer however this thread remains open due to the general nature of its subject @TW_Tones

Yeah, it is almost purely a matter of styling. I’m just about to go to dinner but I’ll see if I can dig up something when I get back in a few hours.

1 Like

Yep, it’s the essence of what I do now, with TiddlyWiki. :slight_smile:

I haven’t worked with randomizing, but you can unpack whatever you want from the title for a missing link.

I think of these as “nodes” — one or more ViewTemplates has instructions for what to display at that node, regardless of whether a tiddler exists there.

You can also use cascade conditions to display different templates at different missing nodes, based on filter conditions.

Usually, the filter conditions I use rely on searching for the node’s name somewhere in one or more fields of existing tiddlers.

This reply was originally marked as a SOLUTION however this thread remains open (without a solution) due to the general nature of its subject. @TW_Tones

1 Like

I think I need to get to this viewpoint. Once people started explaining this, it becomes very clear. I need to get past some it-must-be-a-tiddler thinking.

The worst thing, is that I’d already seen this recently, in our Recipe discussions. @vilc’s Przepisy does this, and I commented on it! But when I went looking myself, I didn’t recall where I’d seen it.

Thank you very much for the help. I’m pretty sure that when I next get an hour to play around with this, I will be easily able to proceed.

OK, I found this ol’ (and unremarkable) experiment. If I understand whatever I did it is more of a styled transclusion… but I would think the styling can be applied to some divs instead to fake a tiddler. I kind of think I had done that too but can’t find it. Anyway, it might be something.

1 Like

I’ll add one more “feature” of missing tiddlers.
I modify the default search (shown when linking with Ctrl+L or associated editor toolbar icon) and Auto Complete for links after [[ trigger (which I use much more often than Ctrl+L) to also search for missing tiddlers (and identify them visually as such).
This way when inserting a link, I immediately get the feedback that it is missing – which means there has been at least one other tiddler referring to it already. It also lessens the chance that I’ll link to something missing two times under similar but different names.

That makes sense. It isn’t necessary for my case; no one will be searching for a card by name/number. But I can see it being quite helpful in general.

I’m not following it right now, but I will at it more deeply when I have a few minutes.

Actually, this brings up an interesting problem in our vocabulary.

When the off-the-shelf TW refers to “missing tiddlers” (in the “Missing” tab under “More” sidebar — it means tiddlers to which links point, but without a destination actually there. (And it is only in that sense that you could manageably search for “missing tiddlers”)

Yet in another sense (such as in the expression [is[missing]] in filter notation), “missing” has no such connotation. It’s simply a logical location in tiddler-naming-space where in fact there is no tiddler.

The tension between these two would not have mattered back when @jeremyruston put the concept of missing tiddlers into motion. But surely the Sidebar>More>Missing concept of “missing” is in line with what most people care about (checking for “dead links”). When my cascade condition calls up a template based on whether what’s in the story river [is[missing]], this use of the word is tracking a much broader category — one that could never result in a list!

Perhaps, for that reason, something like “virtual tiddler” or “virtual node” or “empty node” might be a better phrase than “missing tiddler” for those of us thinking of leveraging templates to show real stuff at these locations, even in the absence of links (within the wiki) pointing to them. Obviously they’ll get called into the story river (or other display area) somehow, but that can be through permalinks or other url / story-river manipulation, so there’s no “missing tiddler” (in the sidebar sense) involved.

1 Like

Interesting discussion again. If we look at what tiddlers are at a minimum they have a title. To me missing tiddlers, are links to titles that don’t yet have a tiddler. That is they are not really missing tiddlers but missing titles.

  • I think it would be safer if we call these missing titles

The idea that you can pack a virtual title with more information, is an interesting one but I am coming to realise there are other tricks up our sleaves.

  • No matter how you create a virtual title it must be written in a field of an existing tiddler, typically within a text field.
  • as soon as you do this the virtual title has additional information the one or more places it is mentioned, that is a virtual title has backlinks.
    • For example you could have a tiddler called “provisional todo items” and place a number of titles as title links in there. They then become missing titles that exist in “provisional todo items” and thus they have the property of being “provisional todo items”.
  • but do remember you can do something almost identical using a data tiddler, the titles if not a link to a title, will just not appear as missing titles.

I have recently been playing with custom namespaces. It allows a custom prefix to also become a system tiddler like those with $:/ and thus don’t appear in standard search and other places. See Expanding the is system namespace

  • I mention this because you can use this method to generate missing titles that are hidden from view unless looked for.
  • The names space could even be the prefix that defines what the virtual title is for.
  • My current alternative name spaces are effectively just additional system tiddler prefixes, but as a result of this discussion I have the idea,
    • that if I create another name space, add it to the system tiddlers but also override the link widget, to not display links with this prefix, then we have an easy way to introduce virtual titles that are backlinked but not rendered, and don’t come up in standard search.
      • Now I just need to find a good prefix.
    • Also a namespace that is the same as above but displays the prefix only but is a link to the virtual tiddler, with a tooltip, may also have a purpose, or trigger another behaviour, eg generate an external link.
    • If we use my previous work of alt-titles and masquerade tiddlers the possibilities are endless.
    • Relink also allows you to safely rename titles allowing them to move between names spaces without destroying links to them.

This is a good idea and could be included in our recent discussion for “tag pills without tag tiddlers to be Italic”, and a related one, “underline the current tiddler in the dropdown list of tagged tiddlers in pills”, so you can quickly go to the current one and its position.

The more information, and options we can give to the user within the same interface all the better.

Hm, I’m not sure why this would be so. For example, you could build a proof-of-concept number theory tiddlywiki where there is not a single tiddler with a number for a title, and not even any numbers tucked into fields. Instead, there’s just a bunch of view templates that would fill in content for any given virtual numeric node – once its node title is listed in the story river.

For example, if you loaded this site with a permalink ending in #13 you might get a tiddler-frame in the story river (for this “missing tiddler”) with the title “13”, followed by various view-template segments including one explanation of its status as odd, another that explains its status as prime, another explaining its status as a star number, and another explaining what it means to be an amenable number. All this could happen without 13 appearing explicitly in any field, or as a backlink. :slight_smile:

Each view template just checks a mathematical filter condition to see whether and how it displays within this (virtual) tiddler.

In general (apart from this fanciful example), non-numeric virtual-node titles probably do most naturally become useful by having templates that scan for their own title strings (or recognizable parts/transformations thereof) in various existing tiddlers’ fields. (That’s certainly how the author nodes work on the bibliographic demo I’m developing.) But nothing makes this necessarily so!

So are you saying another way to get a title in the story?

  • Without first creating a tiddler
  • Without creating a link and thus a missing tiddler?

If I edit the $:/StoryList and add the title first and the beginning of the list I get first at the top of the story, which is displayed as a missing tiddler.

In this case it is an entry in the list field of the $:/StoryList tiddler.

But if I understand you correctly you would modify the rendering of the story so “virtual titles” that match a particular pattern, or filter, will simply be rendered a different way with a special template, but we never give the opportunity to make it into a tiddler?

  • I believe something similar is already possible by creating a Story Tiddler cascade to use a nominated template according to the above “particular pattern, or filter”
  • To keep it simple and to illustrate this what if, missing tiddlers with the prefix # use the virtual-number-template, that removes the # and presents information about the number that followed it.

Here is a two tiddler hack. Note I still used a link [[#13]] to open this in the story, until such time as there is another way other than editing the story list, list field

Virtual-number-tiddler-hack.json (634 Bytes)

  • Note this is a very simple template so when such a “tiddler” is in the story is has no frame and will appear above an existing tiddler.
  • It still gets listed in the Open tab

And that of course is how I intend to use this. The numeric portion of the title will be the only data needed by a ViewTemplate to display my content, the output of which will likely include Previous and Next links to other virtual tiddlers, and maybe a Random link as well.

Starting this chain might be a permalink URL or a random choice or a numeric input field. But there are no tiddlers involved.

In my above example any action navigate will open it in the storey

<$button to="#13">Go 13</$button>

I am enjoying the intellectual inventiveness of this, but to me in many ways it’s no different to building and displaying some other list.

  • I hope someone gives a working example.

Post script;

Remember also a missing tiddler/virtual title can also come into existence in any tiddlers tag field, then it is also a tag and can tag multiple tiddlers, while still not existing.

I don’t have much free time this week, but I hope to be able to demo my idea by the weekend.

In the meantime, there are many missing ingredients in @vilc’s Przepisy which demonstrate such a technique.

http://scott.sauyet.com/Tiddlywiki/Demo/BullshitBingo.html

(While it works in mobile, it doesn’t work well. I’ll get around to finding a fix at some point.)

The tiddler you first see has links to 1000 non-existent tiddlers (plus a random choice.) When you click one, it opens up to show you a Bingo card with 24 terms drawn from a list of awful corporate jargon.

The cards are built using a repeatable pseudo-random number generator (using a Linear Congruential Generator.) If “repeatable” and “random” sounds incompatible to you, you’re not alone. But here it means that you can seed the generator with an initial number, and it will return a consistent random-ish sequence using that seed. Eventually, these will be entirely fixed – the same number will return the same card arrangement every time. That’s not true yet, because I will be fiddling with the list of terms for some time. But once that settles down, the card number will dictate the choice and layout of terms.

The mechanism by which these non-existent tiddlers are rendered, is precisely what people explained to me above. When you visit Card_NNN, a custom ViewTemplateBodyFilter notes the Card_ prefix and points to the template $:/_/bb/templates/bingo-card. This template extracts the card number, NNN, from the title, and then uses a custom filter operator along with the complete list of Terms and the card number to generate the terms to be used for the card. I use some HTML to format this as a table. (There is a gross inefficiency here. We regenerate the list to render each cell of the table. I’ll get to it; I promise!) The implementation of this filter is entirely in JavaScript. Maybe some day I’ll think about whether I could do this in wikitext, but I feel no urgency about it.

Thank you to all who helped steer me in the right direction!


(And if you want to suggest snarky definitions for any of the majority of Terms which remain undefined, I’m all ears!)

3 Likes
Fast Track
(pseudo-verb): to rush an initiative toward implementation, without any time to check for long-term consequences, or grammar.

Thanks.

I took the liberty of making “Or grammar” its own sentence (fragment). It strikes me as funnier that way.

http://fourwindssoft.com/scott/Tiddlywiki/Demo/BullshitBingo.html#Fast%20Track

“Grammar” is the difference between knowing your shit… and knowing you’re shit.

:slight_smile:

This conversation needs to continue in my view, and @btheado and @Scott_Sauyet inspired me back to this subject here Concept: tag intersection - #22 by TW_Tones where bethido is placing filters into titles of missing tiddlers.

  • I will remove the making of a solution and annotate it so the conversation remains open, Given its very general title.

I led myself to believe I was following a new path into the world of “virtual tiddlers” but discovered here others words, even my own that had being here before, however I think I have opened my mind further as an explorer in this branch of the TiddlyVerse.

One key understanding is we tend to think of “the story” as the display of a list of tiddlers, and the nuanced example of a missing tiddler. However this view is heavily biased by our everyday use of the story. In fact the story is at most a list of titles, whether they have tiddlers or not.

When in fact the story is a list with enhancements view templates and now with the cascades, anything in that story can be treated anyway we want, be it hidden, missing to more advanced dashboards etc…

  • This means we can place anything we want into the “story” simply as a way to make it visible and navigable such as from the open list.
  • other approaches such as @BurningTreeC’s TiddlyFlex - a new Flexbox Layout for TiddlyWiki show other approaches to the story, such as multiple columns, each as a story. Imagin a column containing virtual tiddlers, the other regular tiddlers.