Filter Operator Question: Missing, Shadow, and Tiddler

Open TiddlyWiki. Goto $:/AdvancedSearch
and select Filter tab and enter:

[[$:/core/macros/tag]is[tiddler]]

It returns nothing, as $:/core/macros/tag is a shadow NOT a tiddler

[[$:/core/macros/tag]is[shadow]]

Returns $:/core/macros/tag as $:/core/macros/tag is a shadow tiddler and shipped with $:/core

Then try

[[$:/core/macros/tag]is[missing]]

It rerturns $:/core/macros/tag. May be confusing!

and finally try this one

[[$:/core/macros/tag]!is[missing]]

Returns nothing. May be confusing.


Remarks: A tiddler is a physical entity in TiddlyWiki, But a shadow tiddler is a content embedded inside another tiddler (e.g. a plugin or theme, etc.)

So, missing checks input to see if it is a real physical entity! It returns nothing if the tiddler exist and return the input if it is not exist!

Can I say using it with shadow tiddlers may be confusing and should be avoided?

Can I say using it with shadow tiddlers may be confusing and should be avoided?

In this case with is[missing] I would say yes.



The following filter:

[[$:/core/macros/tag]]

Is a shortcut for:

[all[tiddlers]title[$:/core/macros/tag]]

See: https://tiddlywiki.com/#Filter%20Step where it says: If operator and suffix are omitted, it defaults to title


So if you need shadows and tiddlers you need:

[all[shadows+tiddlers]title[$:/core/macros/tag]]

Then you can ask is[tiddler] or is[shadow] — but is[missing] will be confusing

Hope that helps

I belive if you consider “is missing” to mean there is a link to a tiddler that “is missing”, but can be created when the link is followed. This help make it clearer in my mind at least. I think I @etardiff and @Springer have discussed some tricky but wonderful things that can be done with the missing tiddler mechanisium. Just search talk.tiddlywiki

A good example is Field Operators, which is not a tiddler, but still displays content. This is because of $:/editions/tw5.com/empty-tag-node-template, which is tagged $:/tags/ViewTemplate, and wraps its body in this check:

<%if [<storyTiddler>!has[text]!has[tags]tagging[]] %>
  ...
<%endif%>

I use a slightly different technique in http://scott.sauyet.com/Tiddlywiki/Demo/BullshitBingo.html, where I use the body view cascade like this:

title: $:/_/bb/config/ViewTemplateBodyFilters/card
tags: $:/tags/ViewTemplateBodyFilter

[prefix[Card_]then[$:/_/bb/templates/bingo-card]]

and then that template starts by extracting the card number from the template:

<$let card={{{ [<currentTiddler>removeprefix[Card_]] }}}>
  ... tiddler display here, base on `card`
</$let>

This means I don’t predefine my bingo cards, but generate them based on that single number supplied.

And we can try this out. Think of a number, a positive integer, please. No, not that one! Damn, it Tutones, now that song is going to be stuck in my head all day. Anyway, prepend #Card_ to the number and add that to the end of the url, like this:

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

I certainly don’t have 8675309 hardcoded somewhere, but you still get the same card I get.

(And you also get to have that song stuck in your head, too!)

There are a number of threads. The one I recall the best (probably because I started it to help with the BINGO issues) was Virtual tiddlers.

1 Like

I’ve noted elsewhere that “missing” is an technically an ambiguous word in TiddlyWiki, as it stands. Actually it has THREE meanings.

(1) In the “more” sidebar tab, there’s a subtab for “missing” tiddlers. In this situation, “missing” means: this is a there’s no tiddler there (not even a shadow tiddler) AND at least one explicit LINK is pointing to that node. In other words, this is a trouble-shooting category, useful for cleaning up potentially misleading (perhaps lost because of deletion or old-fashioned renaming) links.

(2) In filter notation, “missing” means something different: it means (starting from what the filter train is already carrying) there’s no non-shadow tiddler there.

(3) This is nearly the same sense used in $:/language/MissingTiddler/Hint EXCEPT that this hint shows up in the story river when there’s no tiddler there at all, not even a shadow.

So, at tw-com, advanced search for [[$:/Acknowledgements]is[missing]] yields $:/Acknowledgements, because it’s a shadow tiddler. But in the “missing” subtab (of the More sidebar tab), $:/Acknowledgements is NOT listed. (And you won’t get a missing-tiddler message if you click there, because the node is defined and has content — as a shadow tiddler.)

Likewise, the names of tags for which there are not tiddlers (such as Images at tw-com) are “missing” in the filter-language sense, but not in the “sidebar-tab” sense. And users might well click on the parent link for such a tag (which is at least italics in recent versions, which helps avoid confusion). But then they DO get the missing-tiddler message in the story river, even though Images is not going to show up in the Missing sidebar.

In my opinion, this is a confusion that ought to be fixed.

Clearly, for backward compatibility, it’s more important to preserve filter behavior than to preserve the caption of a sidebar tab.

I propose renaming the sidebar tab to “Missing Links” or “Empty Links” or something like that. Should I make a PR, or anyone have a better idea?

(Calling them “dead links” is both morbid and misleading… Some wikis may use those links, in ways that @Scott_Sauyet and I have been exploring (including my idea for a default template for any tag that is not yet a tiddler to display at least a list of its tag-children).

1 Like

:100:

  • “Unlinks”
  • “Linkless”
  • “The Great Unlinked”
  • “Links without borders”
  • “Borders without links”
  • “S****y helical spring toy”

That’s already in the main site. See my first paragraph above. I don’t know when it was added, but I would not be surprised that it was based on your ideas…

Oh wait, it was you yourself, assuming springerspandrel (great handle!) is you. Sorry, it takes me a while.

1 Like

Very interesting discussion and I like to have @jeremyruston opinion on this.

This discussion mentions related gaps Using links[] in current tiddler - #7 by TW_Tones and hints at missing links being part of this.