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

Dear all,

[TLDR after the fact; using missing tiddlers for my purpose here (the TW5 backend of a system that dovetails with an iframe-url-builder within an educational LMS – so that what’s displayed is “smart” about who’s seeing it) is probably not be the best. Setting up the url to include a query string instead would be more straightforward, hats off to @saqimtiaz. I still do love the power of missing tiddlers, without which I never would have seen the path forward! :wink: ]

For read-only access, I’d like all “missing” tiddlers not to have any visibility in the story river. (They’ll be functioning somewhat like “cookies” – coming in via a permaview url – that determine which details are revealed in templates, etc.) I do need them to count as being in the story river – just without showing any tiddler title or body.

I’ve figured out how the read-only css can subtract all missing tiddlers from the “open” sidebar tab (which is good, so that they can’t be closed via the x icon in that tab’s list). I can also use cascade templates so that their title and body are blank… but the tiddler frames are still showing up.

For getting the tiddler frames to be invisible in the story river, my attempts at css-only solutions seem to fail so far, except when my stylesheet specifies an actual list of anticipated missing titles (which is ungainly). It’s a challenge to target the tiddler names (or tags) for missing tiddlers… but surely there’s a way?

This is what I tried most recently (again in the read-only css tab), but without getting the desired effect:

<$list filter="[list<tv-story-list>is[missing]!is[draft]!is[system]]"> 
[data-tiddler-title="<$view field=title/>"] 
{display:none;} 
</$list> 

Any quick way (in the Read-Only custom css rules, ideally) to get tiddlers to be entirely faceless in the story river when they don’t exist?

Update: Confirmed at TiddlyWiki.com:

Even though these two tiddlers (tagged $:/tags/Stylesheet) look exactly the same in view mode (when Ghost1 and Phantom2 are missing tiddlers in story river), the second one won’t do the work of a stylesheet:

[data-tiddler-title="Ghost1"] {
  display:none;
}[data-tiddler-title="Phantom2"] {
  display:none;
}
<$list filter="[list<tv-story-list>is[missing]!is[draft]!is[system]]"> 

[data-tiddler-title="<$view field=title/>"] {
display:none;
} 

</$list> 

-Springer

Have you tried CSS along these lines?

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

Every missing tiddler in the story has the class tc-tiddler-missing

You may also find this of interest if you need greater control and want to assign a certain class to the tiddler in the story only under certain circumstances: https://tiddlywiki.com/#SystemTag%3A%20%24%3A%2Ftags%2FClassFilters%2FTiddlerTemplate

Thanks so much! That’s perfect, and doesn’t even need a list filter. :slight_smile:

@Springer I think @saqimtiaz solution may be the “simplest way” but something that came to mind was using a cascade “null story template” for missing tiddlers.

This works with a single tiddler as well $ _config_StoryTiddlerTemplateFilters_missing.json (254 Bytes)

I have an ongoing project to explore the possibilities with the missing tiddler concept, so its interesting to see what you are doing.

  • In recent months I also explored modifying the default link generation.
  • Perhaps in this use case it would be best if “missing tiddler links” were simply displayed as text?
    • This way the link can’t be seen, and they will not be “opened”
    • This sounds like a useful core setting in my view, as other than new tiddler buttons, this is the most common way new tiddlers are created. Something we may want to stop on read only wiki’s.

I would propose a setting “Show Missing tiddler links as simple text”.

  • It would also hide camel case missing tiddlers.
1 Like

FYI, this is already a core setting option, available through the Control Panel → Settings.

1 Like

Hi @TW_Tones Tones,

Plain text is ideal for in-tiddler missing links – the kind of missing links that might be the fault of my own incomplete authoring.

In the system I’m setting up here, a bunch of cookie-like “id-key” tiddler titles are loaded up into the story river via a permaview. Those values are not helpful to the actual reader; it’s somewhere between distracting and curiosity-provoking (in an unhelpful way) for people who view this wiki, through an iframe, to have a sense of how certain elements of the site content are being highlighted for them based on their authenticated point of origin within the campus LMS.

I’m focusing not so much on the links to the missing tiddlers (there aren’t any, except for those in the SideBar open tab, which I’m scrubbing out), but on some of the ghost tiddlers themselves (that is, on making their frames and contents evaporate), since these “missing” tiddlers are just hanging out in the story river as fodder for filtered templates.

Yes, I am, very interested in your “Innovative hack” and the fact it leverages “Missing tiddlers” is interesting.

  • To be clear my cascade solution should do exactly the same as @saqimtiaz CSS solution only differently. It still needs the Open tab hack.

When you say;

  • Is this effectively the URL used to open the wiki?

However if I understand your “project” correctly, the root requirement is passing information in the URL to the wiki that provides “parameters” to the wiki, so different behaviours can be exhibited?

  • This is an interesting approach of yours, and as I said I am accumulating understanding of innovation possibilities on top of missing tiddlers.
  • There are certainly other approaches to the same goal I have “played with in the past” from using the “URL search parameter” $:/info/url/search, cookies and local storage.
    • Note: Using a URL search parameter breaks the “Timimi Saver”, I am yet to get a fix.

Any way thanks for sharing

Exactly. Learning Management Systems such as moodle are little walled gardens that house lots of info about each individual student (who authenticates through the university’s SSO, single sign-on).

A plugin filter like generico enables me (with some admin help, since I don’t have access) to set up “templates” that splice that data into bits of dynamic html that I can then serve up to students. In particular, I use this plugin’s functions to build an iframe with a permalink that includes a couple (non-missing) default tiddlers, along with “tiddlers” based on data fields from moodle.

My actual TW5 does not use student names, nor does it use official student ID numbers in it. That’s because it’s hosted off campus, and I haven’t yet found a way to host it on a campus server while keeping it as edit-on-the-fly easy as it is at tiddlyhost. Although students access it though the LMS, it wouldn’t be that hard to find its real home online (say, by discovering some of my posts here documenting the evolution of the site. :wink: ) It has lots of read-only css, but of course “view source” is always an option for a hosted file that’s not encrypted (and I’m so far from wanting to set up individual encryption for each student!).

For all these reasons, my teaching wikis don’t even have anything like a “tiddler” corresponding to each student. I do of course have student-specific strings tucked away in various fields (ones that are out of reach of the standard search window, and very hard to get at via the iframe portal without significant hacking skills).

Once the permaview puts these student-specific “missing” tiddlers in the story river, I can extract what’s needed for meaningful filters, given some basic assumptions (that one of the missing tiddlers is a numeric string of so-many-digits, another is an alpha string of such-and-such format, etc.). Those filters drive how a template can effectively display custom info for each authenticated student.

And, to make it nice, I can have the student’s first name displayed in various places (since the LMS is feeding it into the permaview) even though the student names are nowhere to be found in the html. :slight_smile:

But the seamless feeling is lost if there’s a tiddler-frame-sized banner in the story river corresponding to each of these “missing tiddlers.” Also, I don’t want them to be intentionally or unintentionally closed, thus destroying how their function should survive during the duration of the iframe session.

Thanks for Sharing, good to see you putting tiddlywiki to work in such a situation. I think it may qualify as a “Gorilla TiddlyWiki” as its not installed on the LMS itself.

  • If you have a working solution stick with it
  • I do think we may be able to find a little more robust and somewhat invisible way to do this rather than relying on the permaview.
  • I have the knowledge to “imagine other ways”, but not YET, the skills to “implement these other ways” :frowning:

One way that comes to mind is;

  • Using the permaview but also a Startup action which extracts the missing tiddlers, sets global variables and closes the missing tiddlers (may be a separate step).

I am very keen for us to develop and share methods to leverage and integrate TiddlyWiki in to other systems.

One pet project is to embed single file TiddlyWikis, in posts/pages, in iframes, in a WordPress site where access and writability can be mediated by the WordPress user authentication system.

  • Ideal also allowing serial editors - check out and in.
  • Similar methods may be used with Moodle integration if you control the server.

Yes, this is what I initially envisioned, but I don’t have the skills to think through the startup actions. (I wonder how many folks, like myself, learn certain tricks, and then overwork those same tricks just because they’re more familiar.)

As you know, I’m very eager for a multi-author solution — not necessarily with intro-level students, but with teaching assistants, maybe also seminar students, thesis students, etc.

If only I could control a server, within the campus domain, that would be as responsive and easy to use as tiddlyhost!

If such a tool (with plug-and-play server setup and multi-author permissions) were developed, I could finally imagine becoming an evangelist for TW-in-higher-ed. As it is, I come across as the weird geek who hates the confines of our LMS enough to cobble together a setup of Rube-Goldberg-esque complexity.

-Springer

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)…]