Simplest way to make missing tiddlers display:none or visibility:invisible?

Of course all you need is an always on device (or class/business hours) on the network, with a static IP Address, running Bob.

However modern networks often make it hard for people to access a node on a network segment in the access layer - office and class room, and they don’t provide a way for you to add it to the domain name service.

  • I once used switches, VPN’s and VLANs to stop this because we had risky users standing up servers in our corporate network (eg game servers).
    • “Gorilla servers” are a security risk as they are usually a way for malware to enter or host malware itself.
    • This is why you often need your server in the network core or server room, but perhaps your organisation does not prohibit this, especially in computer labs, dev teams and other areas.

If all users have access to the internet, you could use tiddlyhost itself, not multi-author without a check in/out facility), after all, TiddlyWIki’s are just something at the end of a URL in you moodle.

  • The best example I am aware of placed on the Internet is @jeremyruston 's AWS solution but I don’t know if it handles multi-author.

There may be additional ways around a secure environment but then you also run the risk of breaking policies.

Umm, you say “of course”… But I don’t know the first thing about Bob. What I do know is that I need to access the wiki from anywhere, and I’m not always on the university network. (Adding a VPN/VNC hurdle is not something I relish.)

Also, the fact that tiddlyhost now provides a decent history of backups (as well as a warning when one tries to save over a more recent copy) is vital to being able to work from wherever I am, knowing that if I get interrupted and leave a tab open, I’m not going to lose a ton of work if I slip up and start editing a stale window (or if I simply need to find and restore an earlier version of a stylesheet, without losing all the authoring done in the meantime).

BTW, I had never heard of “gorilla” (or is it guerilla?) servers. Guerilla servers sound like stealthy things that might cleverly operate against the rules. Gorilla servers sound like big noisy things that have no concept of rules at all. :wink:

Even though I’m “smuggling” tiddlywiki interface into an LMS environment, I’m not extracting any info from the university’s servers, nor installing anything onto them, nor doing anything that undermines security. Much less am I pounding my chest and knocking things over. :wink:

I prefer to think of my tiddlywiki as a little elven critter, or a duende – a helpful friend who peeks in through the window of an iframe, holds up a magic mirror there, and makes the LMS space seem larger (and more sparkly, and better organized) than it is. :slight_smile:

Maybe I should call it Tardis-ware. :wink:

1 Like

@saqimtiaz, this looks intriguing:

But I find the explanation there to be a bit cryptic, and there are no examples.

Does it work a bit like cascades, so I’d have a tiddler (tagged $:/tags/ClassFilters/TiddlerTemplate) that consists of a filter condition mediated by a “then” operator, after which I specify a class name?

If so, this could come in handy, so that I can build a clear css-level set of visual cues for when a missing tiddler fits certain conditions (its title appears in the xyz field of other tiddlers, or its title is purely numeric and exactly 6 digits, etc.).

(In case anybody’s confused, since I was asking for how to hide all missing tiddlers – I’m hiding them only for read-only viewers of the site. But it’s great to be able to recognize and manipulate the “missing” tiddlers in the story river when I’m troubleshooting as author!)

1 Like

Correct, though you can have multiple filters that match and assign classes, contra the first one wins in cascades. The input to the filter is the tiddler holding the filter and the story tiddler is available in the variable storyTiddler, and the output (if any) is assigned as a class in the story.

Edited to correct variable assignments.

Saq,

[UPDATE: Ignore this post; saq’s post was corrected above]

Thanks! I’m still missing something.

I’ve created a tiddler, tagged $:/tags/ClassFilters/TiddlerTemplate with this content:

[prefix[@]then[teamstyle]]

where I already have a stylesheet with css lines starting .teamstyle (which do apply properly to tiddlers with field class set to teamstyle)

However, the teamstyle class css is not yet getting applied with this new classfilter method (that is, to tiddlers whose title starts with @). What needs to be different?

(Once I understand this, I think it will inspire a reworking of my stylesheets, since filters are so much more flexible than the limited tag-based and tiddler-title-based methods I’m currently using.)

-Springer

Apologies, I mostly use the page template level classes so I had to remind myself of some of the details here. The input to the filter is in fact not the current tiddler in the story but the tiddler holding the filter. We should document the relevant variables.

This is an example of how you would write your filter to get it to work:

[<storyTiddler>prefix[@]then[teamstyle]]
2 Likes

Excellent! This works as envisioned, along with:

[<storyTiddler>is[missing]then[missingstyle]]

So in author mode, any “missing” tiddlers can get the missingstyle class, so as to display their templates with clear visual cues that they’re missing (black background, light text color), all set up via .missingstyle class css in my stylesheets.

Meanwhile, in my read-only css, I can have

.tc-tiddler-missing {
display: none;
}

(I’m also setting up missing links to appear as plain text, in case I have some old aspirational links, or links to things that were renamed while relink plugin was not in place. Also, as a complement to the open tab — which has now been hacked to omit missing tiddlers from its list — I have a :warning:︎ sidebar tab which displays ONLY missing tiddlers and related utility links, and which appears only in author mode. This enables me to reorder and close those missing tiddlers.)

Lots of pieces coming into play here, thanks all!

For what it’s worth, I’ve been trying to leverage startup actions to set a system tiddler’s cookie1 field to {{{ [list<tv-story-list>is[missing]!is[system]nsort[]first[]] }}}, and I’m not getting results, even though a button designed to accomplish that same action works fine.

The first easy explanation was that startup actions were happening before the story river was populated. So I switched to using the $:/tags/StartupAction/PostRender tag. The intended tiddler field does get established, but still isn’t populated with the result of the filter.

I’m writing in haste (hence without all the details), but if you have any ideas about why a startup-action would have trouble evaluating a filter that depends on recognizing missing tiddlers in the story river (even though that filter works fine otherwise), I’d love to hear your thoughts!

-Springer

The tv-story-list variable is set by the $navigator widget.
Startup actions are invoked by the root widget which is outside the $navigator widget, and therefore the tv-story-list variable is not defined. You would need to hardcode the story list title.

[Irrelevant tangent: I thought you meant that I would have to hardcode what the “missing tiddler” titles are… which is exactly what I can’t do, as they’re in the permaview which is configured by the LMS iframe variables (see my thread about generico filters and moodle)…]

No, you would need to hardcode the value of tv-story-list which for the default layout is $:/StoryList.

{{{ [list[$:/StoryList]is[missing]!is[system]nsort[]first[]] }}}

1 Like

Perfect! Now (as @TW_Tones was suggesting) I can actually close those missing tiddlers after setting the fields, and not have to worry so much about keeping them open in order to work with those incoming variables.

1 Like

Note that you can also put the variables in the URL as part of a query string, i.e. after a ? character instead of as part of the permalink.

TiddlyWiki will ignore them, but you can still read them from startup actions.

1 Like

While this thread is open, for potential future development:

How would a filter extract the info from the query part of the url variant being loaded? (I don’t find any obvious documentation on queries / query strings here or at tiddlywiki.com site…)

Visit https://tiddlywiki.com/empty.html?name=ferret&color=purple and then look at the shadow tiddler: $:/info/url/search.

So the startup actions would split/parse the text of this tiddler and extract the information needed and save it in tiddlers for reference.

This is cleaner in the sense that you do not need to deal with missing tiddlers in the story at all.

Excellent, thanks.

The documentation is here: https://tiddlywiki.com/#InfoMechanism

But I didn’t find it with my intuitive search terms (query, permaview, url)… It’s there under “url” – but quite buried under a gazillion tiddlers with a url field.

(So, this request-for-better-documentation is flagged here for the general vague community of people tracking things that could be documented a bit more explicitly!)

That makes me wonder why there isn’t also a $:/info/url/fragment node. Even if it didn’t dynamically update with permalink/permaview actions, it could be very useful to have the initial value (such as #InfoMechanism) available during startup actions.

Does anyone know, was this an oversight, or was it intentional?

Hi @Scott_Sauyet as you note, the problem is that the current info mechanism only handles static information that doesn’t change after the wiki has loaded.

There are some GitHub tickets with further discussion:

Thank you. I read through all those issues, and the concern was exactly the one I expected.

I wonder if there’s a potential middle-ground of creating a tiddler that is removed once the start-up actions have completed. If one of those actions wants to create a more permanent version of the initial state, it’s free to do so, but otherwise, this is just gone. I have no idea if this is done elsewhere in TiddlyWiki now, creating a transient tiddler, but, as an outsider, I can’t see anything fundamentally wrong with the concept.

One nice point is that with the two equally familiar names of fragment and hash, we could do this with one of them, and reserve the other for potential future use without worrying about backward compatibility – although of course near-aliases have their own problems.

I am not sure that there is an obvious, clean way to remove the tiddler at the end of startup, but I’d be more concerned that it would be confusing for users.

I think the best way forward is to extend the info mechanism to support dynamically changing values, along with a mechanism for triggering action strings when an info value changes.